Presently, a lot of data indicate that the disturbance of mechanisms underlying the regulation of sleep-waking cycle coincides with the mechanisms underlying the development of depression. The disturbance of circadian rhythms is one of the core factors in the genesis of the most affective disorders including depression, which indicates the role of the internal biological clock in the pathophysiology of affective disorders. The episodes of depression, mania or hypomania may result from the disturbances in endogenous biological timing. In this review, we have summarized the literature data obtained in animal models or in the patients with affective pathology, in which the connection between the function of sleep and depression was demonstrated. Specifically, we highlight the mechanisms underlying sleep dysfunction during depression (imbalance of circadian rhythms, melatonin metabolism and mechanisms of neuroinflammatory dysregulation) and provide an evidence for the link between sleep function and depression (sleep disturbances during depressive episodes, the effects of pharmacotherapy, chronotherapy, the effect of sleep deprivation, comorbidity of obstructive sleep apnea and depression).