There's not a cap on how many in total you're ever likely to hit - same as max cash BTW - but there seems to be some kind of anti-cheat going on that angers the server gods if you farm too fast.
I don't know exactly what that is or how it might work but here's what happened to me when grinding:
I found after several hours of heavy-duty farming I'd face a barrage of Bart Screens and then it'd only count regular taps and scrap anything from further attempts to farm once I managed to get back in
Do not try to farm any more for at least 24 hours or it'll chuck you out again, but you should find it eases off in about half an hour or so for regular gameplay. I used to watch carefully, such as if I did a load one night and a load more the next morning I'd take a break to be safe.