These words come from Goldsmith, Komlos, and Gold, The Chicago Guide to Your Academic Career, Chicago: University of Chicago Press, 2001.
How long should I keep my hopes up?
John Komlos: I would consider two cycles to be appropriate, provided you really put your best foot forward. I mean by that that your dissertation was in hand and you applied to a wide array of institutions and did not limit yourself geographically or any other way. ...
Penny Gold: It's difficult to tell someone else, I think, how long to persist in looking. I don't know that I would have had the stamina to last through more than three hiring seasons myself. But one of my colleagues ... had been on the job market seven years ... before the tenure-track job... From my perspective, it is difficult to imagine how she could not have been hired earlier, as her credentials were stellar and she's a nice person to boot. But she's in a very competitive field, and an oversupplied subfield within that field.