Meriam-Webster gives actual definitions for both of those words.
: SUNSET sense 2
In short, both of these are fine:
- She took a factory job working from sundown to sunup.
- She took a factory job working from sunset to sunrise.
Merriam-Webster also defines similar words as they relate to the moon.
1 : the rising of the moon above the horizon
2 : the time of the moon's rising
1 : the descent of the moon below the horizon
2 : the time of the moon's setting
So, you could also say:
- She took a factory job working from moonrise to moonset.
(This would not be entirely idiomatic, but the syntax and grammar is fine.)
Last, you could express the same thing in the most idiomatic way:
- She took a factory job working from dusk to dawn.
Asking about conventions of punctuation and hyphenation is too broad of a question to answer in this context. Although grammar is related to style, it's not the same thing. When it comes to making things up so as to describe them in ways that haven't been defined yet, it's a matter of personal opinion, based on whatever conventions you follow that would seem to make the most sense to people in general.
This is why there are such things as style guides. But, in this case, I was able to address the specific example sentences by referring to a dictionary.
(And note that the difference between, for instance, sun down, sun-down, and sundown is just a matter of what dictionary you use and what style you follow.)
Last, the etymology of a word or phrase can often only be answered on a case-by-case basis, and, many times, it's simply a matter of speculation why things came to be the way they ended up.