Your first Pokémon Gym challenge is the Pewter City Gym, where you can challenge Gym Leader Brock.
Challenge the Pewter City Gym
When you enter the gym, there will be a cut scene. Then the person at the door will ask you to show him a Grass or Water type pokémon. You can choose any pokémon that is currently in your party. If you don't have one, try to catch a Bulbasaur in Viridian Forest.
After you are allowed to go into the gym, you can go north and battle Picnicker Amara (or you can go behind her to avoid battling her). She has a level 7 Geodude. If you have Bulbasaur, use Vine Whip on Geodude. You get 140 Pokédollars for winning.
Go farther north and you can battle Camper Liam (or you can walk behind him to avoid battling him). He has a level 7 Geodude. You get 140 Pokédollars for winning.
At this point, feel free to leave the gym and heal your pokémon at the Pokémon Center if you want. You can also buy Potions and other items at the Poké Mart.
When you are ready, go to the back of Pewter City Gym and talk to Brock.
Gym Leader Brock
Brock has a level 11 Geodude and a level 12 Onix. You get 1920 Pokédollars for winning.
After you win, Brock gives you the Boulder Badge. Now that you have this badge, Pokémon up to level 20 that you got from other trainers will listen to you and do what you say. Brock also gives you TM01 Headbutt. You can use TMs as many times as you want.
When you are ready, save the game and leave the gym.
After the Gym
Outside, a mysterious person will ask you a question. You can answer however you want. This person introduces himself as Blue. He gives you five Great Balls.
Now that you have the Boulder Badge, you can buy Great Balls, Escape Ropes, Repels, and battle items from the Poké Mart. I recommend getting at least one Escape Rope.
Use the east exit from Pewter City to reach Route 3.