A single noun made up of two or more words is called a compound noun (e.g., cooking-oil, pickpocket).
The rules on whether to use a hyphen, a space, or nothing between the words in a compound noun are inconsistent. In other words, some exist in all three forms (rare), some exist in two forms (common), and some exist is just one form (most common). For example:
If you follow the process in this flowchart, your compound noun will be safe.
If the one-word version exists, use it. If you're unsure whether to use the two-word version or the hyphenated version, then opt for the hyphenated version. Joining the words in a compound noun with a hyphen(s) is useful to show that the words are the same grammatical entity. It speeds up reading.
Compound nouns with prepositions are nearly always hyphenated because it prevents the prepositions being read as different grammatical entities.
It's a good idea to test for the one-word version with a spellchecker or a dictionary. Note that you can't test the hyphenated version or multiple-word version with a spellchecker because it will test the spelling of each word (even with the hyphenated version). In other words, if you check "pick-pocket" or "pick pocket" (which should be "pickpocket"), your spellchecker will not highlight it as an error.
Here is some more specific guidance on whether to hyphenate a compound noun. Notice that none of the guidance gives a definitive rule. There are always exceptions.
Examples: cowboy, toothpaste, rainforest, sunflower, eyeball, bus stop
Guidance: Usually one word but frequently two
Examples: ballet dancing, mountain climbing, copy-editing, care-giving, bookkeeping
Guidance: Usually two words but frequently hyphenated or rarely one word
Examples: bookmaker, stocktaker, caregiver, cabdriver, winemaker, frame-maker,
Guidance: Usually one word but occasionally hyphenated
Examples: cabinet-maker, barrel-maker, potato grower, chicken farmer, pheasant plucker
Guidance: Usually hyphenated but frequently two words
Examples: daughter-in-law, jack-of-all-trades, mother-of-pearl, birds-of-prey, son-of-a-gun
Guidance: Usually hyphenated
Examples: flying saucer, washing machine, swimming pool, running shoes, cooking-oil
Guidance: Nearly always two words but sometimes hyphenated to eliminate ambiguity
Examples: black market, red tape, free will, full moon, blackboard, greenhouse, highway
Guidance: Usually two words but sometimes one
You should use a hyphen to eliminate ambiguity or to prevent a reading stutter. Ambiguity or a reader stutter (when readers check back to ensure they've understood the meaning) can occur when the first word of the pairing is a substance (e.g., "water" or "ink"). For example:
This is a key point. If your multi-word compound noun is being used as an adjective to describe another noun, then hyphenate it (regardless of whether it is usually hyphenated or not). For example:
This page was written by Craig Shrives.