The key difference between the imperfect and the passé composé is that the imperfect is used to describe incomplete actions and the passé composé is used to decscribe complete actions. Both tenses describe actions in the past. An incomplete action is something you 'were doing' and a complete action is something you 'have done' or 'did'.
For example:
Imperfect: Je faisais mes devoirs. = I was doing my homework.
Passé composé: J'ai fait mes devoirs. = I did my homework.
You also use the imperfect to describe things someone does habitually (i.e. something done reguarly in the past) or used to do. The passé composé describes things someone just did once, at one moment in time.
For example:
Imperfect: Je jouais au foot quand j'étais petit. = I used to play football when I was little.
Passé composé: J'ai joué au foot le weekend dernier. = I played football last weekend.
The other important time when you need to use the imperfect rather than the passé composé is when you are describing someone or something in the past tense. For example:
Elle était belle. = She was beautiful.
Les stylos étaient bleus. = The pens were blue.