After joining Red, Blue, or Yellow team and catching some good Pokemon, you can challenge enemy Gyms or train at one of your team's Gyms.
Pokemon Gyms are claimed by a team and, based on the Gym’s Prestige level, a number of trainers can assign their Pokemon to protect the Gym. One of those trainers is the Gym leader. The Gym leader's level is marked by a crown and has the highest level CP (combat point) Pokemon at the Gym.
To become a Gym leader you’ll have to take over an enemy Gym by depleting its Prestige. Before you can do this, you’ll want to have a good team of Pokemon with high Combat Points.
The next step is finding the appropriate Gym to challenge. Take a look at your Pokemon, then find a Gym that your team could feasibly defeat. You’re not going to want to take a 117 CP Paras to fight a 1000+ CP Pokemon.
Each Gym will have a different number of trainers, and the first trainers you encounter will have the Pokemon with the lowest CP. The number of trainers at each Gym is dependent on the Gym’s Prestige level. As you defeat them, you’ll lower the Gym’s Prestige and kick out the trainers in the Gym as you hit Prestige benchmarks.
After you defeat every trainer in the Gym, the Gym kicks you out. Keep challenging the Gym and you’ll be able to drain the Prestige to zero. Once that team is kicked out, the Gym turns grey and you'll be able to claim the Gym as your own. Congratulations! If you claim it first, you get to be the Gym leader. You can maintain your new Gym leader status by making sure your Pokemon's CP is the highest among your teammate's Pokemon!