El pretérito y el imperfecto:

Consideraciones generales

The usage of the preterite and the imperfect is one of the most difficult aspects of Spanish for an English-speaker. Essentially, both the preterite and the imperfect are past tenses, much as the way "he did" and "he was doing" both express past action in English. The deciding factor between the two tenses is a characteristic of verbs not frequently talked about in English: aspect.

Every action has a beginning, a middle, and an end. When one wishes to focus on the middle of an action, the action is on-going, that is, nothing changes radically (which is not to say that nothing happens). For example, "he was eating" indicates the "middle" of the action of eating in the past. We don't know when he started to eat or when he finished (or even if he finished). We just know that at a certain time in the past, he was in the middle of eating. This focus on the middle of an action is called the imperfective aspect. Not surprisingly, it is associated with the imperfect tense in Spanish, for example:

hablaba / I was speaking
viajábamos / we used to travel
estaban / they were

In each case, there is no notion that the action began or ended, only that at some point it was on-going. Notice, however, that English has three different, common ways to indicate the imperfect: the past progressive ("was speaking") to show that a single action continued, the "used to" construction to show that a series of separate actions continued, and the simple past, used particularly with verbs that show state of mind or body ("was," "thought," etc.) as ongoing in the past.

If the imperfect is used to denote the middle of an action, the preterite is used to indicate the beginning or the end of an action. Sometimes it requires some thought to determine which part of the action is being described. For example, "The telephone rang at 8 last night" sounds like an action that is over and therefore we are describing the end of it. But the point of view is always some point in the past, in this case, at 8 last night. At that time, the telephone began to ring. It wasn't ringing at 7:59, but it very well might have rung until 8:01 or 8:02. When one says, "I shut the door," on the other hand, by the time one says that, the door is already shut; the action has been completed.

There are many other ways to describe when one should use the imperfect or the preterite, but all of them are just different ways of describing the aspect of the verb in question. For example, one usually uses the imperfect to describe background (ongoing) actions and states, or something that was going on when another action interrupted. Likewise, the preterite is used to describe a series of discrete actions that occurred in sequence and then were over. Of course, there are always some uses that do not necessarily fit the rule, such as the fact that one always tells time in the imperfect ("era la una"), and there are even some verbs whose meaning (or at least whose translation) changes when one uses one tense or the other. Here are a few examples; note that the standard meaning is the one reflected by the imperfect:

Verb / Preterite / Imperfect
saber / supe - "I found out" / sabía - "I knew"
conocer / conocí - "I met" / conocía - "I knew"
querer / quise - "I tried" / quería - "I wanted"
no querer / No quise - “I refused” / No quería - “I didn’t want to...”
poder / pude - “I succeeded” / podía - “I was able”
no poder / No pude - “I failed to ...” / No podía - “I wasn’t able to ...

Mostly, the correct usage of the preterite and the imperfect is a function of experience in Spanish, listening to and reading native Spanish, and practice.

Contrasts: The Preterite and the Imperfect

Preterite / Imperfect
In English, usually translates as -ed, though there are many irregulars (ate, ran, slept, etc.) / In English, usually was -ing
(like a video)
Completed action or event - No matter how long they lasted nor how many times they occurred. Limited, completed past event. (like a snapshot) / Repeated or habitual past event
Used to....
Change in physical, mental, or emotional state or condition at a specific time in the past.
Después de hablar con la profesora ayer, estuve menos nerviosa. / To Describe a physical, mental, or emotional state in the past. Background descriptions. Estar. Tener. Pensar. Creer.
Hacia frio.
Estaba nerviosa.
To tell the beginning or end of an action in the past.
Empezar. Comenzar. Terminar. Acabar. / To tell time.
Eran las nueve.

Used together:

The imperfect will describe the way things were (conditions) or what was happening, while the preterite relates a single, completed act which interrupts.

Examples:

La profesora hablaba cuando la clase oyó un grito.

The teacher was speaking when the class heard a scream.

Me caí mientras corría. I fell while I was running.