How long can we live without children?
I am presuming that you are speaking at a human species level.
Perhaps there is a scenario that the whole world is exposed to a virus, which has few other symptoms than permanent infertility. This is perhaps an escape from a biowarfare laboratory, or a deliberate release by terrorists.
In the scenario, I presume the whole world is exposed to the virus in a short space of time, in today's interconnected world, a highly contagious virus could spread worldwide within a few months. I also presume the virus is incurable, has no vaccine and continues to be present, such that anyone who was not initally exposed would be later on.
In the first year or so, not much is noticed until there is a precipitous drop in the numbers of women coming for ultrasound scans of unborn babies. Conversely there is a rise in people seeking treatment for infertility. The individuals concerned still appear healthy and seem to be producing eggs or sperm, except these do not contain any chromosomal DNA whatsoever.
Now lets presume that it is not possible to produce children via in-vitro fertilisation with pre-virus donor frozen eggs and sperm, or by nuclear transfer cloning (like Dolly the Sheep).
9 months after infection became universal, midwives and obstetricians are finding that they don't have much work. A couple of years down the line, businesses that make baby clothes and accessories and formula milk are going bust. A general sense of malaise spreads as babies are no longer around in the world. Depression becomes widespread.
The cause is eventually discovered to be a virus, however there are no communities found that were not exposed, and no human is discovered to be immune.
After five years, primary schools are no longer having any new pupils, and the economic shock to child-oriented businesses like toy manufactures is biting.
Political turmoil ensues as there is pressure to set aside taboos on human cloning, and other experimentation that was hitherto considered unethical.
After 11 years, primary schools close for the last time, and secondary schools start to drop in pupil numbers. The psychological impacts of there not being any more children are now very widespread and there are increasing numbers of people with dysfunctions such as adults regressing to childish attitudes and behaviour.
The economy is in freefall, since the declining population means that the demand side of the economy is weak, given that housing supply outstrips demand. With little housing construction, building jobs decline, and furniture and manufactured goods often purchased by people buying a house also drop in demand. Jobs working with children such as teachers are disappearing, and because there are no parents taking a break from the workforce to look after children there are more jobseekers than jobs available, unless they are in the medical research sector, or robotics (since it is anticipated there will not be any more young people to do manual jobs, and there will be many old people needing assistance).
After 18 years, the employment situation starts to improve, since there are no longer any young people entering the workforce, unemployment starts to decline again. Schools are now converted into museums of childhood. Universities continue as research institutions, and take mature students.
Robot children are created, which at first are just really household pets, which help people's psychological need for family. However eventually they become sentient.
So humanity eventually disappears about 150 years after the virus (there were some life-extension technologies, and perhaps there were a few very isolated pockets where virus exposure was delayed). But the new Homo Roboticus is exploring the solar system, and the galaxy awaits.
I would expect that humanity would find a way to reproduce. Life has been doing this for 4 billion years. Even if no-one could become pregnant, I expect once ethical considerations are set aside, pre-virus gametes would be used to create an embryo, or nuclear transfer cloning, and implant it into a non-human host, even an artificial womb would be attempted in this scenario and perhaps eventually producing a live baby.