UPDATE: Apparently, Niantic has taken notice of everyone's complaints about the slower rate that coins come in from defending Pokémon. There has now been another change to the rate at which defending Pokémon earn coins. Instead of 1 coin per hour, it is now 1 coin per 10 minutes up to a maximum of 50 per day. From the Silph Road subreddit:
Update: There have now been 2 silent changes to coin accrual in the new system:
Coins are now granted 6x more frequently: in 10 minute increments, rather than hourly
Gym coin earnings are now capped at 50 coins/day
The new limit was confirmed on Niantic's support page, but has since been removed. This is what it originally said:
You redeem your PokéCoins only after your Pokémon returns from the Gym. You can redeem a maximum bonus of 50 PokéCoins per day. If you have more than one Pokémon return from Gyms in a single day, the maximum bonus for the day is still limited to 50 PokéCoins.
Regardless, the maximum is still 50 coins per day, which means that after a Pokémon has been in a gym for 8 hours and 20 minutes, it will no longer earn any coins for you.
As of the recent update that completely overhauled the gym system, the length of time a Pokémon is in a gym determines how many Pokécoins you are rewarded and you are given this reward all at once as soon as the defending Pokémon is returned to you.
Based on the observations of players here, it appears that there is a minimum amount of time a Pokémon needs to be in a gym before it will give any rewards upon being removed from the gym. From the comments there, it looks like the minimum amount of time a Pokémon must be in a gym is 1 hour, at which point, you will be rewarded a varying amount of Pokécoins starting at just 1 Pokécoin when the Pokémon is returned to you.
Having one in for over an hour still results in no coins.
*edit: GOT MY 1 COIN, after crashing/restarting the app. must have been a glitch.
Mine was in the gym for over an hour and I also fed him a berry before being returned. ... just got my 1 coin
My snorlax was kicked out and came back with one coin only
How long approx was it in for?
A little over an hour I think.