Gym badges only raise your Pokémon's stats in Gens I-III. The Gen I-III games are:
- Pokémon Red/Blue/Yellow
- Pokémon Gold/Silver/Crystal
- Pokémon Ruby/Sapphire/Emerald
- Pokémon FireRed/LeafGreen
In Gens I-II the badges boost your stats by 12.5%, and in Gen III they boost your stats by 10%. Specifically in Gen II, badges also boost attacks of that gym's type, and give a 12.5% increase. (Example: the badge from the Flying Type gym will boost Flying type moves.)
Note that not all badges give stat boosts, just some of them. The gym leaders will usually tell you if their badge gives you any boosts, so just resist the temptation to button mash through the dialogue.
Hope I helped.
Source: Bulbapedia, my knowledge of gym leaders in older games.