Here's why:
* It's a direct address: "Hi John" is a salutation, directly addressing someone.
* Direct address doesn't require a comma: When directly addressing someone, the phrase is set off by commas only if it's in the middle of a sentence. For example, "Hi John, how are you doing today?"
Let me know if you have any other grammar questions!