>>33468260Gamepress says you need 40k total badge exp. (gohub says 30k, I dunno)
1 minute of defending time is +1 exp.
Putting in a defender is +100 exp.
Feeding a berry is +10 exp.
Spinning a gym sometimes gives +7 exp but it's rare, I dunno why.
Fighting a defender gives you +1 exp per 100 current CP of the defender.
Raids give +1,000 exp.
Basically a defender who never gets kicked out will take about a month (27.77 days). You can speed that up by feeding berries every chance you get (10 berries per mon per 30 minutes per 10 mons across all gyms per 30 minutes), doing raids, and fighting defenders.
Basically you don't HAVE to hold the gym to grind the badge, you just need to camp/visit it often enough to grind some badge exp every day. If it's a highly contested gym, that's great because fighting 6 mons + depositing a defender is like a free half day's worth of badge exp. Worst case, you get 200 exp for depositing + feeding it 10 berries. Then it gets taken and you repeat. Raids are definitely basically a free day's worth of badge exp.
But if it's a bit out of the way and you can't be assed to visit it enough times a day to get 1,000 - 1,440 exp a day, it's going to take more than a month. I have a gym for example (pic related), that I only hit up on the way home from work. I've been grinding at it since the gym rework and it's still not done. Fucking sucks because it's camped by Mystic carfags who drive out within 15 minutes and I really need to hit other gyms instead of camping it all night.
I have very few gold badges but a large stack of "almost done" silver badges.
You can easily tell which gyms were more contested than others. These screenshots were taken when I achieved the gold badge (aka. the defender came home) so you can get an idea of how much time/fighting went into getting the gold badge.
tl;dr - Ballpark 1 month of defending time for a gym badge. Adjust higher/lower depending on how much you can camp it.