You’ll earn PokéCoins when your Pokémon stays at gyms. The longer they stay, the more you’ll get. It’s important to show your Pokémon great love and care to make it stay in the Gym for as long as possible. When your Pokémon leaves the Gym, you’ll earn some PokéCoins by making it come back. You receive PokéCoins when they return from a Gym, and you’ll get an in-game notification of the amount of PokéCoins earned.
If you earn more than 50 PokéCoins per day, they will be taken away at the end of the day but you’ll still be able to earn more. If you have any Pokémon return from Gyms in a single day, the bonus for this day is capped at 50 PokeCoins. You’re able to get a Pokémon that has already been near a Gym 3-days before, but the number of coins you can collect is limited.
How to Get More Pokecoins?
Pokecoins are acquired in Pokemon Go a few different ways. Most people will acquire them through playing, but you can also get more than 50 pokecoins with this hack for pokemon go.
By leaving a Pokemon at a Gym, you can actively earn coins by controlling the Gym in other ways and putting power into your team. The way this system works is that while you’re playing, Rattata gradually earns coins over time and as it does, so does your team will earn more Pokecoins.

It takes an hour of this to earn about six total Pokecoins, which can only be awarded when a Pokemon that has earned them through the gym is beaten. You’ll need to keep a Pokemon in a Gym for about 8 & 1/2 hours if you want to earn the full daily limit of 50 PokeCoins.
Just be careful what Pokemon you pick if you’re not sure of the Gym — they might be inactive for a long time and not able to defend their turf. I should know, I left my local ones out at the same time. Ugh!
The fact that he still only returns one fifth of what he would earn is a bit concerning. He was able to earn so much over there but without anyone to knock out of the Gym, not even 50 coins actually comes back to me.
If you have a lot of Pokemon, you can make the 50 Pokecoins per day limit a little easier to hit by garrisoning multiple gyms at once. You still won’t get any more coins from that Gym, but you’ll likely have many more to choose from if it survives.