I always see 哈哈, 呵呵, 嘻嘻, and 嘿嘿 in WeChat, QQ, etc, but I don't really understand the subtle differences between them and when to use them appropriately, especially 呵呵. I use 呵呵 myself now, but I'm not sure I'm using it correctly.
I'm taking my answer primarily from this 百度知道 post.
Hehe is the most general laugh, indicating perhaps just a smile. Its meaning is the most vague and in some situations can imply an embarrassed, self mocking, or even sarcastic laugh.
（Update: note the added caution that @shellbye gives in his answer about the meaning of this one. I suggest you keep observing its usage before using it too freely yourself.)
Haha has the clearest meaning. It's a great big happy laugh.
Xixi is mostly (but not exclusively) used by females and conveys a sense of mischievousness and lightheartedness. In certain situations it can even have an air of 撒娇. Xixi is perhaps something like "hee hee" in English. (I spell it "hee hee" and not "he he" so as not to confuse it with 呵呵.)
Heihei is a mischievous or cunning laugh and is used more by males. It can also be an honest laugh, though, too.
"呵呵" means something different in online chat.
At first, "呵呵" is as simple as "哈哈"，“嘿嘿” when I even used it a lot in online chat.
Then, "呵呵" become the best choice when you do not know how to reply to someone's message. So this is where things goes wrong about "呵呵". When someone keep talking to you, and you reply nothing meaningful but "呵呵", sooner or later, he or she become boring about the words.
At last, a picture changed everything. It show below:
Ever since the picture got famous on Internet, people stop using it as its usual meaning but means something different. Sometime it's a joke, sometime it is offensive.
By the way, "呵呵" was the top 1 of of "the most hurting words in online chat of 2014". Full list shows below:
Since you mentioned Wechat and QQ in the question, I'd say in a normal chat, there is no significant difference among 哈哈, 嘻嘻 and 嘿嘿. Normally when you chat online, your partner express his/her happiness via these words. Suragch gave a nice explanation of these words.
But 呵呵 is something different. I mean there are some implicit meanings recently. When you chat with Chinese young people, you may want to know the implicit meaning. 呵呵 = Well...OK/WTF. It really depends.
For example, your close friend showed off something to you but you think it makes no sense or is stupid. Here you can reply 呵呵。By replying 呵呵, your friend understands your thought and it won't cause any bad effect to your friendship.
Here is a simple conversation for you to understand:
all of those are onomatopoeias
actually the meanings vary a lot if you speak a different dialect.
for example 嘻嘻 is /xixi/ in mandarin, /hihi/ in Minnan, /heihei/ in Cantonese.
if you are used to 嘻嘻 in mandarin and you read a comic book from hongkong, you'll wonder why those handsome masculine protagonists /xixi/ like a girl who falls in love the first time while actually the author means a cheeky /heihei/.
This is only one example, but if you look at the news papers or daily languages in regions of different dialects, the way they use onomatopoeias are fundamentally different.
The 4 are onomatopoeia words on the sliding scale of distance between the upper and lower teeth from haha(widest open mouth, to hehe(slightly smaller mouth opening), to hei hei (narrow mouth opening), xixi or heehee (narrowest mouth opening). Wider mouth opening corresponds to a hearty laugh, the narrower the mouth opening, the more reserved is the attitude, with hei hei is bit cunning and heehee even more so or a bit feminine as ladies act more reserved