The second gym badge is obtained from the second gym you visit. However, each gym is different per game. For example, the second gym is located in Eterna City in Platinum but in Emerald, the second gym is located in Dewford Town. So which game are you referring to?
the obvious answer, the second gym. if you're asking where the second gym is, then it depends on which version you're playing.
Dewford Town.
in eterna city
go to eterna city
Level 30 or under
You will have to defeat Bugsy in Azalea Town. He has bug-type pokemon.
The second gym is located in Eterna City and uses Grass-type pokemon.
it is bugsy the bug type leader
You can trade as soon as you get the first badge but you should wait until you get the second instead.
you can find it near the second gym badge and its in a cave.
You should get the second badge from Bugsy in Azalea's gym. If you can't get inside the gym, then you need to drive Team Rocket out of Slowpoke Well first.
first go to cinnabar island second loo for the keys at the pokemon mansion
To use cut outside of battle in Pokemon gold version you need the second badge from Azalea Town from the gym leader Bugsy.