In French, the 'passé composé' is used to describe actions which have already been completed in the past (which have finished). These include events which have only occurred one time (je suis né/j'ai commencé l'université) or those which only occurred a certain amount of times and are now finished (je suis allé en Espagne deux fois).
The 'imparfait' is used to describe past actions or events that are 'incomplete' - that means that there is not such a clear indication as to whether they have ended. This includes actions that were performed regularly in the past, such as things you used to do (je regardais la télé tous les jours), that are still going on (nous mangions le petit-déjeuner à 7 heures), or that occurred for a completely unspecified amount of time (j'étudiais à l'école). In addition, the 'imparfait' is used for descriptions in the past, mainly how things looked or felt (le bâtiment était énorme / elle se sentait triste).
Both tenses can be used together to describe the background action ('imparfait) before a sudden or specific event occurs ('passé composé') (je dormais quand il est rentré dans la maison).