Of 15,500 12 to 18-year-olds studied, those who went to bed after midnight were 24% more likely to have depression than those who went before 2200.
And those who slept fewer than five hours a night had a 71% higher risk of depression than those who slept eight hours, the journal Sleep reports.
It is estimated 80,000 UK children and young people have depression.
The researchers from Columbia University Medical Center in New York looked at data from 15,500 teenagers collected in the 1990s.
One in 15 of those studied were found to have depression.
As well as the higher risk of depression, those who were set a bedtime by their parents of after midnight were 20% more likely to think about suicide than those whose bedtime was 2200 or earlier.
Those who had less than five hours sleep a night were thought to have a 48% higher risk of suicidal thoughts compared with those who had eight hours of sleep.
Teenagers who reported they "usually get enough sleep" were 65% less likely to be depressed.
Depression and suicidal thoughts were also more likely in girls, older teenagers and in those who had a lower self-perception of how much parents care about them.
Most of the parents of the adolescents in the study set a bedtime of 2200 or earlier.
A quarter set a bedtime of 2400 or later.
On average the teenagers were having seven hours and 53 minutes sleep a night - less than the nine hours recommended at that age.
Study leader Dr James Gangwisch said although it it was possible that youngsters with depression struggle to sleep, the fact that parental set bedtimes were linked with depression suggests that a lack of sleep is somehow underpinning the development of the condition.
He said a lack of sleep could affect emotional brain responses and lead to moodiness that hindered the ability to cope with daily stresses.
This moodiness could affect judgment, concentration and impulse control.
"Adequate quality sleep could therefore be a preventative measure against depression and a treatment for depression," he added.
Sarah Brennan, chief executive at the mental health charity YoungMinds, said: "Enough sleep, good food and regular exercise and all essential to stay emotionally healthy.
"Nearly 80,000 children and young people suffer with depression, yet we are still failing to provide our young people with the help and support to cope with it and prevent it.
"Providing parents with information about how to look after your body, for example by getting enough sleep, and how to get help if they are worried about their teenager, will ensure problems are tackled early and prevent serious mental health conditions such as depression."