If you are attempting to "bulk up" while training, then yes, going to the gym will impede your running. Going to the gym is not bad for marathon training - in fact, it will help you. When you start training, you will be running 3-4 days per week and increase that to 5-6 days. Cross-training is very important for marathon training. Your legs needs some time off from running, but you still need to maintain your fitness level during the in-between running days. I know several runners mistakenly avoid going to the gym for fear that it will slow them down. Now muscle weighs more than fat, so if you are trying to finish the marathon in under 2 hours, then you should limit the amount of weight you are using at the gym. If you really don't care about your running time, then feel free to lift weights - it will help your running form. I also recommend lunges and squats (your quads will thank you at mile 22) as well as anything to strengthen your core (your back will thank you at mile 16).
Also, keep in mind that your running will start "eating" away your muscles. Marathon training and weight training can be counter-intuitive at times, so you have to adjust your training and diet to meet what your goals and expectations are at the end of 3 months.