There either is a published procedure to leave the pattern (mostly noise related) or you use common sense to leave circuit as soon as feasible. My personal experience tends towards avoiding climb overhead, as there are aircraft entering the pattern at higher than thought altitude (a guy I know always enters at +2,000 instead of +1,000 due to the bad gliding capas of his Bonanza).