Hi Nelson,
As Andy was saying, yes it depends. Both are correct in their own context, so generally speaking the Preterite will be used for completed actions in the past and/or a specific time in the past while the Imperfect is generally used for continuous actions, or habits in the past. The lesson you were seeing is one for just the conjugation so we didn't put any enphasis on time phrases or usage. There are more specific lessons of usage (for both tenses) coming up soon.
Saludos
Inma