One pound of dry muscle (muscle - water/glycogen content) contains just 1800 calories. As a beginner, you should expect to gain 1-2 pounds of dry muscle per month. If done correctly, your total weight gain will approximately consist of 1-2 pounds of dry muscle, about 1-2 pounds of water and glycogen, and 1/2 - 1 pounds of fat. The 2 pounds of muscle and one pound of fat require approximately (1800*2+3500) = (8900)/30 = 300 calories extra each day. If you find you are gaining more than 5 pounds a month (after the first initial stage of training, that first 3 months as a complete beginner), or you see too much fat gain, reduce calories accordingly.
However, if you are a "hard gainer", you will need to slowly raise your calories by 200 per week until you see gains of about 1 pound per week on average.
This article will discuss nutrition choices to help you reach your goals.