I assume you're playing NL ring to go up that much that fast. Yes, it depends. If you want an arbitrary rule of thumb leave when you've either doubled up or lost 50% of your buy-in. Leave prior to that if the table dynamics are such (or change to such) that it isn't worth your time to play there. Say everyone is folding preflop every hand or one guy is raising 10xBB every hand and you're scared to play anything other than AA or KK, etc.

Now, there are plenty of reasons to rebuy and keep playing if you lose early, and there are plenty of reasons to stay and suck the table dry for 5X plus your buyin. But, as an arbitrary rule of thumb, below 50% of buy in or over 200% think of leaving. Take a break, have a snack or something and then start another table if you want.