To maintain your weight your calories intake should be equal to your calorie expenditure. To lose weight you must take in less calories than you use. To gain weight you must consume more calories than you use.
It takes 3500 calories in or out to gain or lose one pound.