after 12pm = good afternoon
(have a) good night = only said when saying goodbye, after 5pm, (but usually only after 9-10pm) - always means "goodbye for the last time tonight, sleep well" etc
good evening = said anytime after 5pm. either for a greeting or for goodbye.