THE HYPHEN: A NEVER-WERE-THERE-SO-FEW-SOLID-RULES PUNCTUATION MARK
You can use a hyphen to split a word at the end of a line, but you can also use a hyphen to join compound words.
The rules about when to hyphenate a compound word are extremely vague. The problem is that compound words go through an evolution from open compound (two separate words), to hyphenated compound, to closed compound (one word with the two parts together)—and sometimes back again—and the changes can seem arbitrary. For example, when the Shorter Oxford English Dictionary was released in 2007, it eliminated sixteen thousand hyphenated words. Some words (leap-frog) advanced to closed compound form (leapfrog), and other words (pot-belly) reverted back to open compound form (pot belly). The best advice is to consult a dictionary when you aren't sure whether to hyphenate a compound.
In very general terms, you use a hyphen to avoid confusion. For example, when two adjectives modify a noun, sometimes the sentences could be read two ways or be initially confusing to a reader, so you can use a hyphen to clarify which words to together:
Paula wanted a short haired dog.
(Could be read to mean that Paula wanted a short dog with hair.)
Paula wanted a short-haired dog.
(More clearly means that Paula wants a dog with short hair.)
A hyphen also eliminates confusion when it is used to clarify pronunciation:
I need to re-press my jeans.
I need to repress those memories.
Often a hyphen is used between two adjectives that come directly before the noun they modify, but not when they come after the noun they modify:
They are in a long-term relationship.
They are in it for the long term.
Despite the vast wiggle room in hyphen land, there are a few solid rules. You can confidently use a hyphen when you are joining a prefix to a word that must be capitalized, joining a letter to a word, and writing out numbers from twenty-one to ninety-nine.
It's fine to occasionally make up an adjective using a long string of hyphenated words for effect, but don't overdo it to the point that you become an irritating hyphenate-for-no-reason writer.
Sources: Grammar Girl, CMS