About the imperfective verbal aspect, you can read here.
And in this post, I’m going to name the functions of the perfective verbal aspect.
When we speak about things in the past and the most important part of it - the fact that it’s finished by now, there is a result of the action.
Вчера я сделала уроки и легла спать - Yesterday I did my homework and went to bed. The fact that the homework is done allowed me to go to bed. Both verbs are perfective. Легла спать is literally lied down to sleep. A similar function has Present Perfect tense in English, so sometimes present perfect and perfective aspect can be translated into one another.
Limits of action (start of action or a completed act)
It partially what has been said earlier, but the start of action is also the perfective aspect. In Russian there are lots of verbs, or, to be more precise, many prefixes that mean the start of an action, especially with the verbs of motion, Start or finish is just a moment that has a long process of doing something before or after finish or start. And as imperfective aspect is about processes, all the quick actions that take a single moment are always perfective.
Мальчик вышел из дома - A boy went out of his house.
Девочка побежала в школу - The girl ran to school (started running).
Imperfective aspect is used to describe routines, and perfective aspect - one time actions. We usually use perfective aspect when we tell a story about something that happened with us, and here are some words that can be used only together with perfective verbs: быстро, сразу, вдруг, наконец, неожиданно, пока не + V, (quickly, instantly, suddenly, finally, unexpectedly, not yet/until).
Of course, we can speak about the same actions in perfective and imperfective aspects. If it’s important to state that you did your homework every evening, you use imperfective, if in the context it’s important that you’ve done it yesterday, then use perfective.
If you name the sequence of some actions that have been done, then use perfective aspect. But sometimes imperfective aspect also can be used if you are just listing what you were doing:
Я приготовила ужин, вымыла полы, помыла посуду и погладила одежду - I’ve cooked the dinner, washed the floors, washed the dishes and ironed the clothes (the result is that everything is clean and ready now, perfective aspect).
Я готовила ужин, мыла полы, мыла посуду, гладила одежду - I did all these things, but I’m not stating that I’ve done them.
There was an old school joke: When the teacher asks if the student learned (выучил - perfective) the poem or rule or theorem, it’s important to answer with the imperfective verb (Я учил(а)) to state the fact that you at least tried and deserve indulgence.
Completed action in future
Some promise we make to do something in future:
Я обещаю, что напишу эссе, когда приду домой - I promise that I’ll write the essay when I come home / I’ll finish the essay.
Я пойду в спортзал после нового года - I’ll start going to the gym after the New Year holidays.
Inevitable facts in future
We can give promises that we’ll do something, but it doesn’t mean that these things will be done, but we can’t deny, that there are some things that we can predict for sure.
Я обещаю, что напишу эссе, когда приду домой - I promise that I’ll write the essay when I come home / I’ll come home sooner or later.
Когда я умру, этот дом унаследуют мои дети - When I die, my children will inherit this house.