We used to be able to collect 100 coins every 21 hours. Now, its 50 coins every 24 hours (so less than half of before), and depends on opposing teams kicking you out of gyms. I suspect this is so they can get more people to pay for coins, and something all players should be made aware of. Also, CP does not matter anymore. In fact, higher CP Pokémon lose CP faster over time while in a gym. What a way to punish people for working hard for their high-leveled Pokémon, Niantic!
Kutsui about Pokémon GO, v1.37.2