A person's lifespan is determined by many factors, some based on genetic predisposition and others on lifestyle and environment. Statistical studies of twins and families have shown that maximal potential lifespan has a significant hereditary component, but actual lifespan is strongly affected by other factors.
First, lifestyle has a major affect on lifespan. Smoking, obesity, bad diet, alcohol and drug consumption and inactivity can reduce lifespan significantly. Good habits increase lifespan. Vegans and vegetarians outlive people who eat meat. Good nutrition, exercise, maintaining an appropriate weight, and avoiding cigarettes, excessive quantities of alcohol and recreational drugs improve lifespan.
Environmental factors such as air and water pollution may reduce lifespan, as do risky behaviors like drunk driving, living in a war zone, gang membership, and gun ownership (contrary to NRA myth, people who own guns are more likely to die a violent death than people who don't).
Access to medical care is also an important predictor of mortality. Citizens of the United States have a shorter lifespan than citizens of all other developed nations due to lack of universal access to affordable health care, while citizens of Japan, Scandinavian countries, Canada, France, Italy, etc. where socialized medicine is the norm, live longer than people in the US.