The length of time a person can live in space depends on several factors, including their physical and psychological health, the availability of food, water, and oxygen, and the conditions of their spacecraft or space habitat.
Currently, the longest continuous time a human has spent in space is just over a year, by astronaut Scott Kelly, who spent 340 consecutive days on the International Space Station (ISS). The ISS has life support systems that provide a livable environment for the astronauts, including air, water, food, and waste management.
In general, astronauts aboard the ISS spend approximately six months in space, after which they return to Earth for a period of rest and recovery. The human body can endure long periods of weightlessness in space, but it can also suffer from negative health effects, such as muscle and bone loss, changes in vision, and alterations in cardiovascular and immune systems.
Without the support of a spacecraft like the ISS, the length of time a person can survive in space is limited by the availability of life support resources, such as oxygen and water. The maximum time a person could survive in a vacuum without a spacesuit is estimated to be around 15-30 seconds due to rapid oxygen deprivation and heat loss.