The first 4 to 5 months of a puppies life is a very critical period. They are growing up very quickly and taking in a whole new world. If bought from a breeder your new puppy was most likely introduced to outside stimulus and has already begun learning to socialize with other animals. If you have adopted a rescue dog then you may have a harder chore on your hand. Most of these dogs, if not found before the first 16 weeks, will grow up fearful of other adult dogs and new experiences.
I had an abandoned bull terrier come to me once whose owners were concerned about her nipping at the kids. She was a lovable and caring dog all around but very protective. She was probably about 8 months old and had lived most of that time out on the streets of a small town. It turns out she would become very anxious anytime it stormed and get defensive. This type of phobia is difficult to change and sometimes requires professional help and a lengthy bit of counter-conditioning. This is why it is so important to start introducing your dog to outside stimulus as soon as possible.
Getting a puppy before they have had a good enough chance to interact with the litter can also cause issues. During the first 8 weeks these puppies learn to socialize and play with each other. Missing out on these experiences could present problems in the future.
The most important part of raising friendly puppies is trying to expose them to as many situations as possible while they are still young. Like babies though they can become overstimulated if exposed to too much at once. Taking advantage of low cost puppy kindergarten classes is a great way to start getting your puppy accustomed to others. Visiting family or friends with small children or other pets can also be very beneficial. Make sure to keep plenty of tasty treats around for others to give to your new dog so they start associating meeting new people with a positive experience.
While most puppies are not fully protected until they have had all their shots waiting until they are could be detrimental to their future development. Keeping to safe and clean areas to expose them to others and just using a common sense approach should minimize the risk. Dog parks or other high traffic areas should definitely be avoided. If around other animals be sure you know their background and they have a good vaccination history.
With the rate of pets being euthanized because of behavior problems escalating each year, teaching your pet good socialization skills can be the most important thing to enjoying a healthy and enjoyable life together. As most pet owners know having a companion that is happy and fun to be around goes a long way in the type of relationship you two enjoy.