That is a very good question, as both describe actions of the past. We use the preterite tense when we talk about actions which are seen as being completed in the past, notably one-off events. For example, you could say: 'Charlie corrió dos horas', because one day in the past, Charlie started running, and then he stopped two hours later. Hence the action has a definite start and a definite end. However, if Charlie made a habit of running by doing the action everyday, you would use the imperfect tense. This is because it refers to actions which appear to keep on going, as in they happen repeatedly, so they don't have a definite end. So you would say 'Charlie corría dos horas al día', which can mean 'Charlie used to run everyday'.