The purpose of the weak interruption mentioned by Barrie is pragmatic. We need help in reading and understanding more complex sentences. In print, a comma is used to signal a logical shift from one thought to a related one, where a more forceful punctuation mark or a new sentence is deemed too - er - punctuative. In spoken English, pause and intonation is (/are) used.
If a comma were not used in your third and fourth examples, there would probably not be a problem, so I'd say it was optional there. In your second and fifth examples, it's starting to get a bit unwieldy without the comma. The first example definitely needs the comma to defeat the garden-path nature of the sentence :
While I was eating the cat scratched ...
Sentence connectors like however, on the other hand, in addition, furthermore, moreover, additionally, besides, firstly, secondly, next and finally always take a comma. Note, however, the difference between
Finally, we come to the question of what to do about persistent re-offenders.
where finally is used as a sentence connector, and
He finally left the office. / Finally(,) he left the office. / Finally(,) I went home.
where finally now is a matrix adverb, and the comma is not mandatory.
Other pragmatic markers, like modal and other sentence adverbs
(Seemingly, he doesn't earn enough to be able to afford a new Jag.
Politically, it becomes quite a problem.
Confidentially, you need to watch him.)
are also set off by commas.