This is a very big question so I will give you a summary answer to give you a general idea. In Spanish there are three past (pretérito) tenses as follows:
Pretérito Indefinido: This is used to talk about actions that were completed in the past, so you would often see a reference to "last year, last month, last week" when the action occurred.
Example: Last year we went to Segovia - El año pasado fuimos (Verb Ir) a Segovia.
Pretérito Imperfecto: This is used if you are talking about actions that were repeated or done habitually in the past, and for describing what was happening at that time. The aspect of describing is really important here.
Example: I used to swim every week - Solía (Verb Soler) nadar cada semana. There is a brilliant lesson about describing what was happening in the past called "Using the Pretérito Imperfecto to describe a situation in past" which you should search for. It is crucial to understanding this tense.
Pretérito Perfecto Compuesto: In English you would see sentences like "Elvis has left the building" or "María has qualified as an engineer" or "They have eaten all the cakes." You can see that two verbs are combined here i.e "have (haber in Spanish) and the participle of the second verb. Be careful because in Spanish they are nearly always translated in the same way as the Pretérito Indefinido i.e. "Elvis left the building," "María qualified as an engineer" but in this course you are always given a hint to point out that you will need this tense.
So when do you use this tense? You use it when you are talking about an action in the recent past i.e. "this morning, this week, this month" which belongs to the time period that you are in at the moment. There is a really excellent lesson about this called "When to use the perfect tense versus the simple past in European Spanish." You should search for it at the top of the "Dashboard" page.
¡Buena suerte! John