From Bulbapedia, the community-driven Pokémon encyclopedia.
A Gym can house multiple defenders, the maximum number of defenders being equal to its level. If in range of the Gym and there is room for another defender, a player on the same team as the Gym can add one of their Pokémon to the Gym. Each player can only add one of their Pokémon to each Gym.
Only Pokémon with full HP can be deposited in a Gym as a defender. A Pokémon placed in a Gym cannot be removed until it is removed due to the Gym's Prestige falling too low, at which point the Pokémon will return to its owner's collection, but with only 1 HP. While in a Gym, Pokémon cannot be [[Evolution|evolved]]
or [[Power Up|Powered Up]].