German has two everyday ways to talk about the past, and for most events they mean the same thing. The Perfekt is built from an auxiliary verb and a past participle: ich habe gespielt and ich bin gegangen. The Präteritum is a single word: ich spielte and ich ging. The difference is mostly about where you use each one.
In speech: the Perfekt
When you talk about what happened yesterday, last week or last year, German speakers normally use the Perfekt. The Präteritum would sound stiff or bookish in a casual conversation.
Gestern habe ich einen Film gesehen.
Yesterday I saw a film.
In writing: the Präteritum
Novels, fairy tales, news reports and other written narratives mostly use the Präteritum. It is the tense of storytelling.
Es war einmal ein König.
Once upon a time there was a king.
Der Minister sagte am Montag, er werde zurücktreten.
The minister said on Monday that he would resign.
The exceptions: sein, haben and the modals
A handful of verbs are used in the Präteritum even when you are speaking, because the Perfekt versions are long and awkward: sein (war), haben (hatte), and the modal verbs (konnte, wollte, musste, sollte, durfte). The verb es gibt is also usually es gab in the past.
Ich war gestern im Kino.
I was at the cinema yesterday.
Wir hatten viel Spaß.
We had a lot of fun.
Ich wollte dich anrufen.
I wanted to call you.
Most of the time, then, a sensible rule is: speak in the Perfekt (except for those verbs), and read and write stories in the Präteritum.
A note on regions
The pattern is stronger in the south. In southern Germany, Austria and Switzerland the Präteritum is even rarer in speech, and the Perfekt does almost all the work.
Forming the Präteritum
Regular (weak) verbs add -te to the stem: spielen → ich spielte. Irregular (strong) verbs change their stem: gehen → ich ging, kommen → ich kam, sehen → ich sah. You do not need to master these to speak, but you will meet them in every book.
