HeHe and HaHa aren't really words, they are just a phonetic spelling of how some people laugh. In a similar way to how Moo! is used to represent the sound that a cow makes or woof the ound that a dog makes.
This is way you will see HeHe or HeHeHeHeHe to show that you were laughing longer.