Here is a simplified form of how your muscles grow and why sleep is so important:
First, when you lift weights, what you're doing is actually tearing the muscle tissue in a healthy way. After you eat your body uses certain nutrients to repair your muscle tissue. What you need to remember though, is that the protein and your body won't start repairing your muscle tissue until you are at rest for a extended period of time, such as sleep. What this means is that if you are lacking sleep, your body isn't getting sufficient time to repair and recover your muscles one hundred percent.
One extra tip to keep in mind if you are training hard to gain weight and/or build muscle mass, is to try as best you can to get an extra hour of sleep during the last few weeks of your program, especially if you are really training intense. If your schedule does not permit you to get enough sleep every night, the next best thing to do is to do your best to take as many naps as you can throughout the day.
Remember, if your goal is to gain weight and build muscle fast, it is always better to rest throughout the day as much as possible. That means if you can walk rather then run, do so. If you can sit rather then stand, do so, and so on. The more rest you give your body in-between workouts, the more you give it time to properly repair itself, and the better results you will get.