To gain weight, you need to consume more calories every day than you burn with physical activity. You can also gain weight by increasing the size of your muscles. Start with a calorie calculator to determine the number of calories you you'll need to consume every day to gain weight. You'll probably need to increase your calorie intake, and you can do that by eating a larger volume of food or by choosing foods that are energy-dense (high in calories).
Either way, you should choose foods that are nutrient-dense instead of settling for high-calorie junk foods. Nutrient-dense foods include fruits, vegetables and whole grains. Foods that are both energy- and nutrient-dense include legumes, nuts, seeds, olives, and avocados. You may also want to increase your consumption of dairy products, meats, seafood and poultry. Use seasoning blends, herbs and spices to add flavor and aroma.
The main goal is to increase your overall intake of calories every day; it doesn't really matter if you eat more meals or increase the size of the meals you eat right now. If you're not used to eating much at any one time, you may prefer to eat several small meals or snacks throughout the day. If you'd rather eat three meals each day, increase your portion sizes or add more foods to each meal.