I think we'd be far better off without "gg" (and "glhf" for that matter). But I recognize that "gg" is here to stay, so here's how I use it.
• If I lose a game, I will say "gg" usually followed by "Well played." In this case, "gg" means "Thanks for playing this game with me".
• If I win a game and my opponent says "gg" and doesn't immediately leave, I will say "gg" back. In this case, "gg" means "Thank you for not leaving right after saying "gg".
• In rare cases, if a game has been extremely close and interesting, I will say "gg" even if I have won. In this case, "gg" means "That was a good game."
• In very rare cases, I will say "gg" even if none of the above apply. In these cases, "gg" means "That's right, fuckwad! I beat your goddamn bog-standard Minion enigne! How does that taste, you incredible asshole!?"
EDIT: • I also say it right before I ragequit. Sort of a courtesy so they're not caught off-guard when I ragequit.