"Good night" as a greeting was once a feature found almost exclusively in Ireland. In James Joyce's "The Dead", for example, it is used both as greeting:
—O, Mr Conroy, said Lily to Gabriel when she opened the door for him, Miss Kate and Miss Julia thought you were never coming. Good night, Mrs Conroy.
And as a farewell:
—Well, good night, Aunt Kate, and thanks for the pleasant evening.
I suspect, but do not know, that this was a retention of something that died out elsewhere sooner than in Ireland.
In any case, it has mostly died out here too. It may be heard from an older generation, and perhaps lingers in some regions, but my generation (mid 30s) wouldn't use it either in the region I grew up, nor where I now live.
"Good evening" would be the more normal night-time greeting.
The only logical explanation I can think of for our no longer using "good night" in this way, is that it is so often said to someone about to retire to bed, that it was hence used more often as a farewell and then came to have only this meaning. The other forms, after all, would be more often used as a greeting than a farewell, though historically that was not the case.