They are both used to talk about the past, however the imperfect tense talks about something that happened habitually or over a long period of time in the past and the passé composé is used to talk about a finished one-off action that happened in the past. For example: To say: "When I was younger I played tennis" you would use Imperfect as you played tennis multiple times when you were younger. "Quand j'étais plus jeune, je jouais au tennis"To say: "On Sunday I played tennis" you would use the passé composé as you only played tennis on Sunday as a one-off completed action. "Dimanche, j'ai joué au tennis"