Strength is a move that is learned by certain Pokémon, not an ability that a trainer can learn. You can obtain the Strength HM (Hidden Machine) from a hiker on the road to Ecruteak City after you defeat the Bugsy at the Azalea Town gym. You can then teach the Strength move to a compatible Pokémon, allowing you to push boulders out of the way.
The gym leaders you battle do not teach you any moves or abilities. They are simply there to test your skills.