The quick answer that most pediatricians will give is 6-8 weeks. Infants in the first 2-3 months of life are susceptible to numerous infections both viral and bacterial. Some of these include RSV, pertussis (aka whooping cough), and influenza. Newborn infants do not have the immunity to protect themselves from these infections.
Most pediatricians understand his is not always practical to a family's day to day routine. Most do not expect new parents to lock themselves in their home and not leave for 8+ weeks.
Here are a few tips to help keep your baby well when out and about:
1. Have family and friends visit your baby at your house. This way parents are able to "screen" for anyone sick who may want to visit.
2. Avoid large gatherings, especially gatherings with many small children. Parents have better control over who is touching and holding their baby if gatherings are small or hosting visitors in the home.
3. Make sure anyone holding your new baby washes their hands or uses hand sanitizer. Also, keep extra sanitizer in your diaper bag, purse, or stroller when out.
4. If out running errands, go in the morning when less people are out. Avoid crowded areas with poor ventilation (i.e. the mall).
5. Avoid extreme heat or extreme cold when going out. A good rule of thumb is to dress baby in the same number of layers an adult would be wearing. A light blanket or jacket can always be added if necessary.
Do not stay cooped up in the house for 2 months. Follow the above tips, use good common sense, and enjoy going out and getting some "fresh" air with your new baby.