If you put two or more words together to make a new one, it is a compound word. For example: 'lighthouse' (light + house); 'mother-in-law' (mother + in + law) and 'post office' (post + office). The last word is an example of the so-called open form compound word: the two words are written separately to form a new word.
If you are unsure about whether a word should be one word, two separate words or hyphenated, the best thing you can do is look in a good dictionary, such as the Oxford English Dictionary or Collins. It's better than searching online as these dictionaries are authoritative and are very unlikely to make mistakes. It's also a handy thing to have in your collection of non-fiction books!
This topic is actually quite complicated; however, we'll stick to the common compound words in this 11-plus quiz.