The time will depend on your definition of 'irrevocably doomed'. Based on your wording, it seems that you are focusing mostly on the biological survival of the species. However, there is also a cultural/civilisational aspect. In some sense, the loss of civilisation is also an extinction.
Biological survival: 50 years to infinity till the humanity is doomed
Biological survival means that the species do not go extinct. However, it does not guarantee retaining culture and civilisation.
The conservative estimate assumes:
- no serious medical advances are made in the near future;
- sterility means not only sterility of eggs and sperm but also inability to carry a baby to a term;
- frozen eggs, sperm, and embryos were rendered infertile.
As others noted, modern women in developed societies are capable of bearing children till the age of 50. Some women do not experience menopause till their 60s, but childbearing is extremely risky at this age.
Minimal viable population for the survival of species is approximately 4200 individuals. This has to be local, not global, population. Considering that 1) it is much harder to get pregnant and successfully deliver a baby for mature women; 2) babies are at much higher risk of genetic disorders (both parents age is a contributing factor here), the latest time when the curse must be lifted is when about 10,000 women are still fertile. Children and mothers must be transported to a single location with the mild climate and fertile land to ensure the species survival.
The optimistic estimate can be achieved through:
- human cloning and genetic engineering (sexual reproduction is overrated anyway :) ):
- only cloning can be enough if we develop a way to create perfect copies (no mutations), but humanity will be unable to adapt to changing environment;
- genetic engineering solves the problem of imperfect clones, it also allows to imitate evolution;
- eternal life and youth:
- the species does not have to have babies in order to survive if they are immortal.
Cultural survival: this is a bit tricky
Civilisation and technology heavily rely on population size. It is not possible to keep the modern level of development with just 10,000 people. I saw estimates ranging from hundreds of millions to billions of people. So, if we are optimistic, the curse must be lifted when it is still possible to deliver, grow, and educate about half a billion of babies. This gives probably 10-20 years. In a pessimistic scenario, the time shortens to a couple of years (maybe a decade, but not longer).
A possible workaround for the population size problem is total robotisation. If everything (including robots' repairs) is fully automated you only need to take care of the biological survival.
Another possibility is abandoning biological survival altogether. The entire world population can be digitised and uploaded to the servers. Of course, total robotisation is a must for this plan to succeed.
You also must take into consideration the effects of total infertility on society. This was addressed, for example, in The Children of Men.