Greetings - Social Language

Once you have been introduced to someone, the next time you see that person it is important to greet them. We also greet people as we leave people. In English (as in all languages), there are different ways to greet people in formal and informal situations.

Formal Greetings: Arriving

Good morning / afternoon / evening.
Hello (name), how are you?
Good day Sir / Madam (very formal)

Informal Greetings: Arriving

Hi / Hello
How are you? 
What's up? (very informal)
How are you doing? (very informal)

It's important to note that the question "How are you?" or "What's up?" doesn't necessary need a response. If you do respond, these phrases are generally expected:

Very well, thank you. And you? (formal)
Fine / Great (informal)

Formal Greetings: Departing

Good morning / afternoon / evening.
It was a pleasure seeing you.
Goodbye.
Note: After 8 p.m. - Good night.

Informal Greetings: Departing

Goodbye / Bye.
See you (later).
Later (very informal

By Kenneth Beare, About.com Guide