My mother tongue is Finnish and Finns are famous for using really long compound words. English also has compound words, too, and there's a great example list of compound words on another site.
Some examples from that list:
Closed-form compound words: snowball, mailbox, grandmother, basketball, skateboard, schoolhouse
Hyphenated compound words: long-term, mother-in-law, check-in
Open compound words: peanut butter, ice cream, real estate
Can I create my own compound words to be used in formal context? If so, is there any logic to figure out if my newly created compound word is closed-form, hyphenated or open compound word? And even the above list is not complete because you have to write "ice-cream cone", if I've understood correctly.
(For example, in case of Finnish, the rules are very simple: all compound words are closed but if previous word ends with the same vowel as the second part starts with, you have to add hyphen between those parts in written form. This is required because otherwise both vowels would be accidentally read as part of one syllable. In spoken form there's no difference because syllable break between the parts is enough in all cases.)