Viability is generally considered to occur around 24 weeks of gestation, although this can vary. Advances in neonatal care have pushed this threshold earlier, with some infants surviving after being born as early as 22 weeks of gestation. However, survival rates and long-term outcomes improve significantly after 24 weeks.