I know @cyndiepooh has exclusive rights to this link, but this time I will post it ![]()
Here is a good article explaining S2 Cells and how they impact gyms: A Comprehensive Guide to S2 Cells and Pokémon GO | Pokémon GO Hub
Gyms are decided in Level 14 cells. Each level 14 cell contains 64 Level 17 cells, so up to 64 PoI in Pokemon GO. The number of PoIs determines the number of Gyms in Pokemon GO:
PokeStops (PoIs) Gyms 1 0 2-5 1 6-19 2 20-34 3