In French, we call mot composé « un ensemble de mots formant une unité syntaxique et sémantique » (a series of words behaving as a single syntaxic and semantic unit). Whether the parts of a mot composé are linked by hyphens is almost entirely up to usage, and is determined by historical reasons. Examples of mots composés linked in various ways are:
- “cache-cache” et “saute-mouton” (hyphenated),
- “portemanteau” (agglutinated),
- “aujourd’hui” (apostrophe),
- “tête de nègre”, “petit pois” et “pommes de terre”.
But for each mot composé, the usage is rather well-established and does not vary depending on whether it is used. The only such example I can think of is: when a mot composé is used as a colour, it may be hyphenated (as noted by Joubarc, it is not systematic):
(And it’s not “une jupe verte petit-pois”!)
Mise à jour, mise en jeu, garde à vue, coup de gueule can be analyzed and are used in the valid grammatical context (mise, garde, coup are names) even if they acquired a fixed meaning. They are called locutions and it is an intermediate state in the formation of words. Words further in the process may acquire hyphens or even be agglutinated.
Even early on, we are using hyphens either when the group of words isn’t used in the grammatical context which would be demanded by the analysis (fait-tout, saute-mouton), when the meaning resulting of the analysis can still be employed (après-demain, après demain), when analysis is difficult or not possible (cache-cache, porte-fenêtre).
Agglutination is more common for older words (for which the compound formation is no more perceptible) and, obviously, when the components are though as prefix or suffix.