Usually people battle in gyms, then collect coins straight away after that. If you can't collect coins because of where your timer is, you just take a break from battling, as it can be a waste of time.
I only ever stayed in gyms for 24hrs+ if they were high level. (6 and above). So that's kind of normal. Low level gyms are an easy target.
With low level gyms, I can only take down two, maximum three, before the first one changes hands again. So I don't aim for more than three.
An exception would be a gym in the middle of nowhere that not many people know about or can get to. You might be able to hold it for longer.