English speakers are fairly loose in this regard. The different greetings overlap, and your reader is unlikely to worry too much about what you use (unless it's 8 a.m. and your characters are saying "Good night."). 

A rough guide, however:

~5:00 to ~12:30: Good morning  
~12:30 to ~ 17:00: Good afternoon  
~16:30 to ~21:00: Good evening  
~20:00 to ~5:00: Good night  

But I really cannot emphasize enough how rough these answers are. The greeting chosen will also vary depending on how light it is outside (You might say "Good morning" at 4:30 a.m., if the sun is up), the speaker's own schedule (If you generally wake up at 10:00, you might stretch "Good morning" as late as 13:00), or day of the week (A Friday "evening" goes later into the day then a Tuesday evening).

If you really aren't sure, just have them say "Hello" or "How are you?". A time-based greeting is by no means mandatory in English.