In order to build muscle, you've got to strength train; make sure you're eating enough carbs, protein, and fat; and be consistent with your training. Another important part of the muscle-building equation that often gets overlooked is recovery and getting enough sleep. Sleep is essential in order for your brain to function: it enhances your creativity and improves your emotional well-being and physical health. A full night's rest will improve your performance throughout the day, but it's also necessary because as you sleep, your body produces hormones like growth hormone, which helps you build muscle. "Growth hormone is released during stage three sleep, which is considered to be the deepest stage of sleep," Dr. Sultana explained. In order for your body to function optimally, adults should aim to get seven to nine hours of sleep each night. A growth hormone deficiency will result in the loss of muscle mass and will have a negative impact on your ability to exercise. It's pretty hard to crush a workout and focus when you're exhausted.
Source: https://www.popsugar.com/fitness/How-Many-Hours-Sleep-Do-You-Need-Muscle-Growth-46190015