Definition 1:
Haha - used to express laughter anywhere you can't say it, for example IM, instant messaging or via email.
The minor difference between haha and hehe is that haha is often used when laughing at someone, while hehe is used while laughing with someone. It might be unconcious to most people, but it's true.
Definition 2: Ha-ha - when haha is pronounced like 'Ha-ha', it often expresses that one do not find something humourous; ironic.
I also found some pretty random ancronyms for haha online:
Having A Heart Attack
Houston Area Hound Association (Texas)
Human-Anti-Humanized Antibodies (immunogenicity testing assay)
Example 1 (haha): You don't know who Shakespeare was? Haha!
Example 2 (ha-ha): Ha-ha, how funny!
Example 3 (hehe): Hehe, you're so funny!
Person 1: hi haha
Person 1: the movie was good haha
Person 1: im eating fucking ramen right now and no one cares haha
Person 2: If you say "haha" one more fucking time I'm going to buttrape you with a cast-iron cactus HAHA
Hah - The person thinks a comment is mildly funny.
Haha - The person does not think the comment is funny, but acknowledges your attempt humor.
Hahaha - the person thinks the comment is funnier than average, or is just more enthusiastic than those who normally say haha.
Hahahaha - The person is just being excessive. Usually used to strengthen a friendship because an inside joke was just mentioned.
Haha is almost never used to express actual laughter occuring. For those circumstances, rofl, lmao, or a whole sentence about how the comment actually made one laugh is used.