Both Imperfecto and Indefinitivo are past tenses.
Imperfecto is a tense used to describe states, emotions, circumstances, settings - it implies that the action has not been finite in the past. For example: It was 7 o'clock = Eran las siete.
Indefinitivo on the other hand, is a tense used to describe finite actions in the past, they were concluded in the past. This tense does not imply any duration of the action at hand in the past. For example: At 7 pm I finally arrived home = A las siete por la tarde por fin llegué a casa.