Even if you're pokemon sits in a gym for something like 4 days you only earn 50 pokecoins when it's knocked out However I belive that since it takes 8 hours to make 50 you should be getting 50 pokecoins every 8 hours or at least everyday that you're pokemon is in a gym