Gyms can hold up to 6 Pokémon, however each trainer can only have one of their own Pokémon on any given gym.

You can have 1 Pokémon in up to 20 gyms, but the maximum defender bonus you can collect from owning gyms is 50. For example, if I had Pokémon posted at 15 different gyms, I could at most collect 50 Pokécoins every 24 hours.