Under the invite tab there are 3 options, everyone, friends or no one.
When you are playing with a group you can chose the"no one" option, which list you then in "tourney mode" and disables invites. You can change this at anytime during the game by clicking on the invite tab. so if you are getting invites during a game it is because you chose to allow it.
The game does switch to "tourney mode" automatically if you are in a tourament, but not for closes to the hole contest, practice or group games.