As seen in the formula, a player can only earn up to 50 per day. Calculations towards the daily limit apply to the day the defender Pokémon is knocked out of the gym, not the day it was put in. If a Pokémon was placed in the Gym on Monday night, and it was knocked out Tuesday morning, the PokéCoins earned will count towards Tuesday's daily limit.