Visit a gym, then right click the player model or the pokemon. After that, you should be directed to a selection of teams.
In order to join a team, you first must be level 5. Then just find any gym (usually easily found by the blue/red/yellow beacons) and click on the gym leader. This will prompt each team leader to talk to you and you can choose a team!