is the all-purpose greeting. It works at any hour, with strangers and acquaintances alike, and the reply is 你好 back. Between family and close friends it sounds stiff; they greet each other by name.
is the polite form, for a teacher, a customer or anyone older.
addresses a group.
Greetings by time of day
in the morning,
in the evening.
alone is the quick version between people who know each other.
你好吗
looks like "how are you?", but it is not an everyday greeting. Between people who see each other often it sounds like a textbook. Day to day, people ask 吃了吗, 忙吗 or 最近怎么样.
?
How have you been lately?
你好吗 fits after a long gap, or when you really are asking how someone is.
Leaving
is the standard goodbye. 明天见, 下次见 and 一会儿见 follow the same shape: time word plus 见.
Thanks and apologies
takes 不客气 or 不用谢 in reply.
takes 没关系.