Rule: Represent numbers in words, not figures, as a general rule, in formal writing. You may use figures for dates (as in April 4, 2002 [omit st, nd, rd, th]); any number requiring more than two words (as in 123); numbers in a set of statistics; page, line, chapter, act, or scene, etc.; or street-numbers. If a number is the first word in a sentence, you must write it out, even if it meets one of the above criteria for writing it as a number.
Note: Multi-word numbers from twenty-one to ninety-nine are hyphenated if used as adjectives. Higher numbers: one hundred and twenty-one, etc.
Examples:
Correct: Nineteen hundred fifty four marked a watershed year for the United States.
Correct: In 1954, our Supreme Court decided one of its most important cases ever.
Correct: I had twenty-seven dresses, but not a thing to wear to the wedding.
Practice deciding which numbers to spell out:
Resources for further explanation of when to spell out numbers:
Grammarly's When Should I Spell Out Numbers?
Purdue OWL's Writing Numbers