When the stars, at set of sun,
Watch you from on high.
Why not "at set of the sun"?
It's a matter of meter. This is a line from a composition in very strict (not to say rigid) meter (the regularity and the rhyme suggest that popular hymns are the model):
/ - / - / - /
/ - / - / repeat ad lib.When the stars, at set of sun,
Watch you from on high;
When the light of morn has come,
Think the Lord is nighAll you do, and all you say,
He can see and hear;
When you work and when you play,
Think the Lord is near.&c
An extra the would spoil the meter.
Poetic license. Neither phrase would be used in everyday English. You'd just say, "The stars watch you from on high when the sun sets."
Sometimes you'd do that in poetry as well. :)