Muscle gain comes from two places: the gym and the kitchen.
If you are trying to build muscle and you haven't considered your diet then it's time you did.
There are a number of things you need to consider when planning your diet if you're trying to build muscle. They're pretty straightforward too: there's no need to obsess over every detail or spend money on expensive supplements unless you're a professional athlete or weightlifter.
Muscles require an incentive to grow, which you give them through resistance training. But they also require large volumes of fuel in the form of calories.
If you want to build muscle without putting on fat, it is important to get the balance of calories in your diet right. Too many and you'll be building muscle and excess fat, too few and your body will not have the surplus energy required to develop muscle, and may even start to break down your muscles for fuel.
To truly maximise muscle growth, if you are working out hard and regularly, you should be eating around 40-50 calories per kg of body weight. This works out to 3200-4000 calories if you weight 80kg, which is around 1000 calories more than the calories required to maintain weight, more or less depending on how much you exercise. If your workouts are not intense or regular, the calorie surplus should be less.
Be careful not to overdo it though. Muscle gain is normally associated with some fat gain, which is why many bodybuilders go through cycles of muscle growth and fat cutting. If you find you're putting on too much fat, cut the calories back a bit. As long as you're keeping up your training, this shouldn't affect your muscle growth significantly. It's also much easier to avoid putting fat on by dropping your caloric intake, than getting rid of it once it's there.
If you're just trying to get lean and gain a bit of muscle, or you already have a bit of excess fat you want to lose, you're better off aiming for a mild calorie surplus on training days, and consuming maintenance or slight deficit calories on rest days. Your muscle growth may be slower, but you're less likely to put on fat in the process, improving body definition faster.
In order to grow muscles, your body requires building blocks of amino acids, which are found in protein. Without a sufficient supply of protein, muscle growth will be sluggish or non-existent.
Research has shown that at least 1.5-2g of protein per kg of bodyweight is required to maximize muscle growth. This works out to 120-160g of protein if you weigh 80kg, which is 480-640 calories of protein.
However, not all proteins are created equal.
Muscle growth in the body occurs through a process known as protein synthesis. The process is complex, follows many steps, and requires many components, but perhaps the most significant is the amino acid leucine.
A study from 2016 compared the influence of protein content on muscle protein synthesis. They found that high leucine content results in significantly higher levels of protein synthesis.
However, you don't have to go out and buy leucine specific supplements to get this amino acid in your diet. Most animal products have high levels of leucine, containing an average of almost 9% leucine, with the best sources being cheese, most meats, whey and egg. Plant based protein sources contain less leucine, but vegan's don't despair: the difference is pretty small, with plant based protein sources containing an average of 7% leucine. If you're vegan I would recommend soy products and pea protein, as these containing the highest volume of this amino acid.
The balance of the other macronutrients in your diet, fat and carbohydrates, has an impact on muscle growth and performance.
When you exercise, you burn calories. If your body doesn't have enough readily available energy, protein synthesis is much slower. A lack of energy also makes for tiring and sub-par workouts. For these reasons, I recommend getting a good amount of your body's favourite form of energy on workout days: carbohydrates. Don't overdo it though - excess carbs will be stored as fat if you do.
On non-workout days, I would recommend easing off the carbs, as diets high in carbohydrates, especially sugars, result in insulin spiking which has a negative effect on your body's ability to process calories, as well as a host of other negative health outcomes. This means that you'll be picking up the slack with fat.
Fat has had a bit of a bad reputation over the years, but it really is an excellent source of slow burn fuel, and provides you with essential fatty acids and fat-soluble vitamins to keep you fit and healthy. I'd recommend a diet relatively high in protein and fat compared to carbohydrates for muscle building, especially on rest days.
There used to be a lot of focus over timing in workouts. People used to think that you had a narrow window in which to consume copious amounts of protein just after a workout, in order to gain maximum benefit.
We now know this isn't the case. A large study published back in 2013 finally showed that timing really doesn't matter so long as you eat within a couple of hours either side of working out.
If you're a really serious athlete and want to maximise gains, there are some advantages to having a protein and carb shake mid-workout, but the benefits are pretty marginal.
If you want to build and maintain muscle, the work starts in the kitchen. Get the calorie balance right: enough fuel to maintain muscle but not so much your body puts on fat. Take in enough protein to give your body the building blocks it needs, and give yourself enough energy on workout days, while easing off on rest days. Also, make sure you're well hydrated, especially on exercise days.
Make sure you get your nutrition right so you are fully rewarded for your hard work.