The preterite and the imperfect tenses are two forms of the spanish past tense, most verbs can be put into either tense but both convey different meanings about the action that was done in the past!
The preterite tense is used for actions in the past that can be seen as completed.
The preterite tense usually implies that the action had a definite beginning and a definite & definable end.
The preterite tense is used for actions that occurred once in the past.
The preterite tense is used for conclusions.
Ayer Maria habló conmigo una hora. (In this example there is a definite start and end point, it is also implied that yesterday this only happened once.)
Esta mañana comí tostadas. (In this example there is a specific time given - this morning. There is only one morning today and thus it will only happen once!)
Signal words for the preterite tense: ayer, anteayer, anoche, durante el siglo, el otro día, el año pasado, entonces.... and many more.
The imperfect tense is used for actions in the past that are not seen as completed.
The imperfect tense is used for actions that do not have a definite beginning or end (eg. used to)
The imperfect tense describes actions that were repeated in the past.
The preterite is used to set the state (eg.describe someones physical features in the past, telling the time in the past, stating someones age in the past, for describing physical sensations in the past etc.)
Las mujeres siempre hablaban en alemán (In this example there is no given start or end time, and we can assume this action was done over a long period of time and not just once.)
Desayunabamos juntos todos los días (In this example we can see from the use of "every day" that action was repeated habitually.)
Signal words for the imperfect tense: siempre, cada día, con frecuencia, nunca, generalmente, todos los días... and many more!
Summary: I find the best way to remember the difference between these tenses in to imagine a stage, if a phrase is describing a background action or setting the scene by either describing the setting or giving background details it will usually be in the imperfect tense. However if a phrase is describing something that is going on in the foreground, an action that is important to the storyline of the play then it will usually be in the preterite tense.
Preterite = describes specific actions
Imperfect = describes general actions