Fruits and veggies are very nutritionally dense foods, but are not calorically dense. This means that when comparing plant-based foods to meat-based foods, for the same volume of food, plant-based foods contains fewer calories. For example, one cup of Yoplait fat-free yogurt has 227 calories and 7 grams of protein compared to one cup of cooked spinach which has 41 calories and 5 grams of protein. So, in order to get the same amount of calories, you would need to eat 5 cups of spinach. Although, the amount of nutrition (vitamins and minerals) in one cup of spinach is far greater than yogurt.
There are many factors to consider when trying to lose or gain weight, but one of the most important and easily controllable is caloric intake. Or, in other words, how many calories you are eating daily. If you want to lose weight then you will need to eat less calories than you expend and if you want to gain weight then you will need to eat more than you expend. So, how do you know how many calories you need? There are BMR Calculators (Basal Metabolic Rate) and Activity Calculators that will estimate your daily caloric needs. Once you figure out how many calories your body needs, then you can track your daily calorie intake by keeping a food log. I personally use and recommend My Fitness Pal. Track you calorie intake for a week and see if you gained or lost weight and then adjust accordingly. 3500 calories is equivalent to approximately 1 pound. So, if you want to gain 1 pound, then you will have to eat an additional 3500 calories. For example, if your goal is to gain 1 pound each week, then you would have to eat an additional 500 calories each day. Calories are calories and are the same whether you follow a plant-based or a meat-based diet and If you consume more calories than you expend then you will gain weight. If you consume fewer calories than you expend then you will lose weight. How much gain or loss depends on how much you eat and exercise.
Before I adopted a plant-based diet I was consuming about 4000 calories daily, mostly comprised of meat and dairy. Now that I have switched over to a plant-based diet I still consume the same amount of calories, although now I eat much more food. If you eat the same volume (i.e.. 1 cup of spinach instead of 1 cup of yogurt), then you will lose weight. If you want to gain weight then you will need to increase the amount of calories or volume of food that you are consuming compared to the amount of exercise or calories you expend daily.