The imperfect is used for description or to emphasise that what you are describing 'used' to happen but no longer does. e.g. quand j'étais jeune, j'avais les cheveux bruns. The passé composé is used to describe one off actions that happen 'immediately' and then stops. e.g. j'ai couru par les couloirs étroites.