If you have some reason to think that you don't have an edge at this table, you should definitely take the money and run if you happen to be up. Table and seat selection are two of the most critical decisions to your
bankroll. But that said, let me try to put it a different way:
If you play to win, and you think that you're a good enough player to beat the limits you're playing at, then it doesn't really make any difference if you play only one hand or 1000 hands. Basically, at any given table, you have a certain
expectation, and if your expectation is good - larger than zero - , you should stay.
This is unlike, for instance, a
blackjack table, where your expectation is always lower than zero (or should be, otherwise the house is doing something wrong). If you're playing blackjack and find yourself doubled up, by all means take the money and run.
But if you think you can beat the game, it makes no sense to leave just because you got on a hot rush early. There's no "counter rush" that has to follow. Every hand you win has exactly zero (mathematical) impact on what cards will be dealt in the next hand. Even if you've had pocket aces five times in a row, your chance of being dealt pocket aces are still 1/221 in the next hand.
If, on the other hand, you're a losing player in the long run, it's true that getting up while you're ahead might be a good thing. But then, if you want to keep your money, you will statistically do better if you don't play at all.
See what I mean?
There are of course other aspects, that are outside of the cards; tilt etc. It's possible that you're the kind of player who gets very protective when you've won money, and are afraid to be aggressive in fear of going back down to where you started. In that case, it might make sense to get up if you're ahead a lot.
But yet another thing to consider is the fact that if you play only a few hands before you get up, you will never have time to identify and make use of reads on your opponents. You will constantly be playing against a bunch of strangers.