They often can be used interchangeably. For the beginner, I think this is a good rule of thumb. While with a continuous tense, when with a simple tense.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.