Written with as many 'w's as you want, this word is used as a silly exclamation. It can be used as a greeting or as an opinion. However, it can be used at any part of a conversation to break the ice, trivialise proceedings, or add some joviality.
John: "Haha. How are you!?"