When should you use the imperfect past tense?

When something was lasting in the past or not finish

Je mangeais quand tu es entré : I was eating when you entered

By the way imperfect is the opposite of 'perfect', which itself means finished, so

imperfect means 'not finished'

It's a bit like continuous tenses in English