Both of these tenses are used to denote events that occured in the past, but they are troublesome for several reasons and used in broadly different contexts. First, it is important to note that the imperfect is more widely used, especially with verbs like avoir and etre. It is used largely to refer to events that were happening, with no indication of when or if they have ended (eg. J'etais a l'ecole - I was walking). The imperfect also details what used to happen on a regular basis (for instance, j'etudiais le lundi - I used to study on Mondays), or to set up the backdrop to a particular story (J'etais a l'ecole quand.../I was at school when). These are the main uses of the imperfect, and so the passe compose is used in opposite contexts. The easiest way to tell them apart is that the passe compose is formed from an auxiliary verb (avoir and etre in the present tense) followed by the past particle (finishing in 'é'). If you see (ai/as/a/avons/avez/ont followed by a verb finishing in é) it is most likely the passé composé.
The passe compose, meanwhile, has three English equivalents