I only use, “Good morning,” to greet people who I know have just gotten out of bed, so I would not use it when I first see people at work or school, because I assume they have been out of bed for some time. Maybe I would say, “Good morning,” to someone at work or school if I see that his hair is still wet from the shower, or if he still looks sleepy. I have noticed, however, that some native speakers say, “Good morning,” as a greeting the first time they see a person each morning.
“Good afternoon,” sounds so formal to me that I never use it unless I’m being playful. “Good evening,” also sounds too formal to use in ordinary situations, unless I’m joking.
People where I live never say, “Good day.” We don’t use it as a greeting or as a farewell. If anyone here says it, they are usually indicating playfulness by using an expression that is considered strange, archaic and overly formal. I think this is true for most Americans.
I would never use “good night” as a greeting. That’s only for departure, and usually when you know you’ll see the person again in the morning.