It means Good game and is a way to show humility in defeat or victory. If you can't say GG or something nice, then dont. Saying stuff like BG or GG EZ can get you banned fast. Of course depending on the context it can be an insult.