I leave when I feel like I don't interact with anyone, don't contribute anything, and I'm taking up a slot for someone who might.
ETA: I say that because every guild I've been in, and eventually left, was a great guild with great people. It wasn't them, it was me.