A way of remembering the difference is to think that the word 'perfect' comes from the Latin 'perfectus' meaning 'completed' while 'imperfect' will therefore mean not yet completed or on-going.
The perfect tense (also known as the passé composé) is used for completed or finished actions in the past.
e.g. Je suis allé au cinéma
e.g. J'ai écrit une lettre
Often a temporal word or phrase will be a good signal that you have to use the perfect tense.
e.g. Hier, je suis sortie avec mes amis
e.g. J'ai visité Paris l'année dernière
In general terms, the imperfect tense is used for an on-going action in the past without a specified time of completion.
Circumstances when you use the imperfect tense:
1) Describing a situation or setting a scene
e.g. Il pleuvait
e.g. Il faisait très beau
e.g. Les oiseaux chantaient et le soleil brillait
(This will often be translated as 'I was, it was')
2) Interruption
The scene you've set with an imperfect will often be interrupted by an abrupt perfect tense
e.g. Je marchais heureusement dans la rue quand quelqu'un a volé mon sac!
3) Habitual or repeated actions
e.g. Quand j'étais petite, je voyageais en France tous les ans
e.g. Je me levais à 7h tous les matins
(In this case, this will often be translated as 'I used to'
With the imperfect you will often find temporal phrases such as these:
le lundi, le soir, le matin… On Mondays, in the evening, in the morning…
d’habitude, habituellement – usually, habitually
parfois, quelques fois – sometimes
de temps en temps – from time to time