Whey protein itself does not inherently cause weight gain. However, consuming more calories than your body needs, including from whey protein, can lead to weight gain.
Protein powder can be a convenient way to add extra calories to your diet, especially for people who are looking to build muscle or increase their overall calorie intake. If you consume more calories than your body needs, the excess calories will be stored as fat, leading to weight gain.
It's important to keep track of the number of calories you consume, and make sure that you are in a calorie surplus if you are looking to gain weight. This means consuming more calories than your body needs through a combination of food and protein powder. However, if you are trying to lose weight, it's important to be in a calorie deficit, meaning you consume fewer calories than your body needs.