Preterite and Imperfect Tense in Spanish:
When to use the Imperfect Tense:
The imperfect tense is used for past tense actions where there is not a specified completion. The imperfect consists of actions that were habitual over a period of time in the past (every week, every 3 days, every year...).
Cada cinco días iba a clases de español - Every five days I went to Spanish lessons.
Antes visitaba a mi abuela todas las semanas - In the past I used to visit my grandmother every week.
Cuando vivía en Madrid, comía mucha paella. - When I lived in Madrid, I ate a lot of paella.
When to use the Preterite Tense:
The preterite is used to talk about completed events, especially those with very clear beginnings and ends. The simple past is for specific actions that did not happen regularly in the past.
Compré una casa nueva en año pasado - Last year I bought a new house.
Perdí las llaves - I lost the keys.
The preterite is used for listing past events that took place in a sequence:
Llegué al cine, vi la película y regresé a casa - I arrived at the cinema, I watched the movie and I went back home.