There is much debate and controversy on the subject of doing cardio while building muscle. Once and for all I am going to set the record straight. So without further adieu, here's the real deal on doing cardio while trying to gain size and strength…
If you are a beginner who also happens to be a ripped ectomorph who has to fight for every ounce he gains (e.g. a classic hardgainer), I suggest that you lay off cardio almost entirely for at least 8-12 weeks. Get your training and diet down and pack on some size. In that time you should be able to gain at least 15lbs of muscle if not 20+. After you have done that you can add in some cardio. I would start with three weekly sessions of twenty minutes of moderate intensity cardio; no intervals. Use a bike to limit the amount of eccentric stress or pounding on the joints. And remember there are actually things known as real bikes that go outside, not just stationary bikes that people park themselves on to watch Oprah. Although, if you choose that route, get one with a well padded seat that will not lead to the death of your sex life.
If you are beyond the beginner level you should always be doing some kind of cardio on a regular basis, be it intervals, moderate intensity steady state, or low intensity, long duration steady state. Again, don't limit yourself to machines indoors; get outside and drag a sled, run sprints, jump rope or play a sport. That's a lot more fun anyway. I think everyone should be doing something like this at least three days per week for at least 30 minutes. It's healthy and prevents a host of health problems, not to mention that it keeps you in shape and looking good.
Contrary to what many people believe, cardio can actually be of great benefit to those looking to get bigger and stronger. Not only does it improve the cardiovascular system and thus improve the quality of your weight training workouts but it allows you to eat more muscle building calories while staying lean. To pack on 20-30 pounds of muscle you have to eat an inordinate amount of food. Doing some cardio will help ensure that you don't get fat from all the excessive eating.
The bottom line is that everyone but absolute beginners should be doing some kind of cardio type activity at least three times per week for thirty minutes. This will not inhibit size or strength gains in the least but may actually enhance them. You should vary your activities and intensities as much as possible. You can do cardio immediately after you train, although I prefer to do it on non weight training days or later in the day after training because I am usually too spent after lifting to give it my all on the cardio. Doing it on off days is usually a better option anyway because it serves as an active recovery activity and also gets you burning some calories on those days.