When writing a text with numbers, when should I use the number representation, when should I write them out?

Questions like this are sometimes quite difficult. Questions about when or how to write numbers or numeric representations should be tagged with this tag. Examples of good questions include:

history | show excerpt | excerpt history