How does the coin limit work?
You are limited to a total of 50 coins a day. That means your Pokémon are also limited to 50 coins total (since you can never get more than 50 in a single day). This means that once your Pokémon has been in a gym for 8 hours and 20 minutes (500 minutes), they are no longer accruing any coins for you.
For example, if you have 10 Pokémon in gyms for a week each, but they are all returned to you within the same day, you will only receive 50 coins. If they are kicked out one per day, then you will receive 500 coins total, 50 per Pokémon for 10 days.