Indefinitely.
It is possible to create new animals by cloning. This technology has never been developed in humans because of severe ethical issues, but faced with extinction, it'd likely be up and running within a decade. The core principles are all understood.
However, this assumes the mechanism of infertility allows implantation of embryos. Even if not it is possible humanised animals could be used for incubation.
To address some objections raised in the comments:
Cloning technology is imperfect: this is certainly true, however it is already the case that cloning is commercially viable. There is a biotechnology company in China that is producing 500 cloned pigs a year, while the cloning process itself involves a high degree of technical sophistication, none of the steps are prohibatively expensive or difficult in themselves. Faced with global infertility, vast sums of money will be made available for research, and enormous pressure placed on elected officials to remove legislative barriers. Under these circumstances we should expect viable cloning techniques to become routinely available in the developed world within a decade, probably faster. Cloning should be inherently about as expensive as IVF but with the extraordinary levels of demand we should expect economies of scale to drop prices fast. 335
I would expect reproductive cloning to be available at around $1000 dollars pretty soon. Too expensive to be routinely available in the developing world, but no problem for developed countries with universal healthcare.
Cloning suffers from the same problems as IVF: IVF is only performed on clients who have exhibited problems conceiving the old fashioned way and are typically older. Accordingly success rates are far lower than we should expect from people who do not have these problems and thus success rates should be closer to the far higher rates observed with egg donation.
Telomere shortening: while this was a concern, it turns out not to be a problem. Even if it was a problem, it should be possible to develop a solution by temporary activation of the telomarases that naturally restore telomeres during normal reproduction.
Accumulation of mutations: cloning will inevitably accumulate mutations. This could be mitigated by long term storage of DNA from the original source but even this would be imperfect since the DNA is likely to slowly degrade even under ideal storage conditions. However, the accumulation of mutations is unlikely to render the process non-viable for a great many generations (plants and animals that self are known to survive for 100s of generations without apparent loss of viability, although cloning methods may induce higher mutation rates so an exact comparison is not possible), and there are a range of existing techniques that could developed to repair (e.g. CRISPR) or screen embyros (e.g. shotgun sequencing) and prevent transmission of harmful mutations. Moreover, in the hundreds of years available to humanity, the development of in vitro techniques to restore crossing-over and mixture of genes as per natural sexual reproduction seems much more likely than not. 1008