Drug and alcohol abuse removes between nine and 24 years.
One in four people in the UK will experience some kind of mental health problem in the course of a year.
It is estimated about one-fifth of people smoke.
The research found that all mental health conditions studied resulted in higher death rates among sufferers when compared with the general population, with a reduction in life expectancy of between seven and 24 years.
Dr John Williams, head of neuroscience and mental health at the Wellcome Trust, said: "People with mental health problems are among the most vulnerable in society.
"This work emphasises how crucial it is that they have access to appropriate health care and advice, which is not always the case.
"We now have strong evidence that mental illness is just as threatening to life expectancy as other public health threats such as smoking."
The study was published in the journal World Psychiatry and was funded by the Wellcome Trust.
The research involved analysing data from 20 studies that included more than 1.7 million people and 250,000 deaths.
Dr Seena Fazel, the study author, of the department of psychiatry at Oxford University, said there were many potential reasons for the findings.
"High-risk behaviours are common in psychiatric patients, especially drug and alcohol abuse, and they are more likely to die by suicide.
"The stigma surrounding mental health may mean people aren't treated as well for physical health problems when they do see a doctor.
"Many causes of mental health problems also have physical consequences and mental illness worsens the prognosis of a range of physical illnesses, especially heart disease, diabetes and cancer.
"Unfortunately, people with serious mental illnesses may not access health care effectively.
"There are effective ways to target smoking. We now need a similar effort in mental health."