When can one greet using the parting expression 'good night'? Can one use it while parting at day time?
"Good night!" is best used in late evening or during the night.
It usually carries the meaning "Sleep well!", therefore it is best used when you know that the person(s) are very likely to go to bed.
For parting during the evening (especially early evening), I prefer to use:
Have a nice evening!
or if its late evening:
Have a nice evening... and a good night!
If it is late at night, I might say:
Have a good night ... what's left of it! :)
Even though native speakers might use "Good night" right after lunch (the the comment from @JassonBassford), as a non-native English speaker (like myself) you should not go to the extremes of the language - at least until you get more experience.