Commas are used to set off names used in direct address. In fiction, this happens predominantly during dialogue between characters.
- Bobby, will you pick up some bread from the store?
- Thank you for bringing the coffee, Suzie.
- Listen up, esteemed colleagues, because this is important.
- John, you know that I love you.
- Thank you, friends.