The studies on snacking and weight gain are mixed. This is because the question of what a person snacks on (and the amount) is more important than the frequency. If you feel that you snack on nutrient-poor foods often (like those high in sugar, flour and refined fats like cakes and pastries) and would like to lose weight and improve your health then you have 3 options:
Eating 3 main meals is ideal for people who may need fuel in the morning (eg. post-workout) or may not be suitable for Intermittent Fasting including those with hormonal issues (especially poor blood sugar regulation, thyroid). The hormone Leptin that supports fat loss also prefers 3 main meals with 4-5 hours between meals and 10 hours overnight.