Several scientific studies show that there is a direct relationship between sleep deprivation (insomnia) and weight gain and obesity. There are many reasons for this and there are a number of other studies that investigate these relationships. One of them would be the fact that lack of sleep alters human metabolism and the sensation of hunger arises, hence, the so-called "refrigerator assaults" take place.
Only a few hours of sleep reduce levels of leptin (satiety hormone), increase levels of ghrelin (hunger hormone), and cause fatigue and increase opportunities to get food. These factors increase hunger, reduce energy expenditure and increase the intake of foods with high energy density, resulting in weight gain. Thus, individuals with deregulated sleep end up entering a vicious cycle, in which they will become increasingly tired and less disposed to exercise.
One way to try to reverse this picture would be to regulate your sleep, keeping in mind that on average the number of hours ideal for daily sleep, to repair the energies spent would be, for the adult individual, between 6 and 8 hours. However, there is still no agreement on how many hours each individual needs sleep per day, as there are several variables of human organisms.