I don't think there is, nor can there realistically be, a "number". As others have stated, it depends on the condition of the rest of the car, the car's sentimental value, the financial condition of the owner, the owner's ability to do the work himself (or to properly maintain the car after the work is performed)...I can keep going.
One also needs to consider ancillary costs...how much more would insurance, sales, and excise taxes be for a newer car? If those costs on the replacement vehicle are higher, how many years would it take to end up costing the same amount as repairing the current car?
Unless the car has enormous sentimental or collector value and is worth any repair at any cost, each case is unique.