All things being equal, eating more calories than you burn tends to lead to weight gain (usually body fat but also potentially lean muscle), and eating fewer calories than you burn will lead to some amount of weight loss[ *].
Practically speaking, the number of calories you eat each day — also called energy balance — is one of the biggest factors in whether you lose or gain weight[ *]. All things being equal, eating more calories than you burn tends to lead to weight gain (usually body fat but also potentially lean muscle), and eating fewer calories than you burn will lead to some amount of weight loss[ *].