You can be rewarded a maximum of 50 coins from Pokemon Gyms. To achieve this, your Pokemon must last 8 hours and 20 minutes. You won't receive any extra coins if your Pokemon lasts longer than this time. Moreover, the maximum amount of coins can only be earned a day. This means you won't be able to receive any more coins if you place a Pokemon in a gym after another has been defeated. While you won't gain extra coins, you will be rewarded by leveling the Pokemon Gym. Which will subsequently grant you more items when you spin the gym.