In Germany, like in most cultures, it is polite to say “good evening” late evening. You can also say “good night” which is slightly different.
There are some important differences - mainly in that one is a greeting and the other is a farewell. Let's go through the differences and the examples below.
You would say this as a greeting when entering a restaurant, for example. When you enter you say “Guten Abend” to the waiter, and they say “Guten Abend” in return.
Guten Abend noch
Schönen Abend noch
This is said when you leave a room during evening time, say after finishing dinner, or after leaving a late meeting "guten Abend noch".
This is only used as a farewell, and only in late evening/night time. You can say this when leaving a party in the late evening.
It is also always said before you go to bed at night time, "gute Nacht".
Greetings or Farewells
Ich wünsche Ihnen einen guten Abend (formal)
Ich wünsche dir einen guten Abend (informal)
Ich wünsche Ihnen einen schönen Abend (formal)
Ich wünsche dir einen schönen Abend (informal)
These can be used either as a greeting or a farewell, and the guten and schönen are interchangeable. The Ihnen is used when addressing someone in a formal context, and the dir is used in an informal setting.
Those rules will get you through evening greeting and farewell situations in Germany. There is no point over-complicating it - learn these rules and try them out in the wild to get used to them and you will be set!
Why not say guten Abend in our online German meetups (7-day free trial) or try our online intensive courses from A2-C1 and business German.