As babies grow, they will start smiling or laughing at things that they find pleasurable like cuddles, voices, and faces. This is known as the responsive smile and it generally happens around the sixth week.
With time, babies will realize the connection they shares with you. They will no longer then smile at inanimate objects that grab their fancy. They will instead try to communicate with their near ones by smiling at them from time to time. They will also try making sounds (chuckle, babble, mooing, oinking, and beeping) to grab attention. This is the social smile, and it generally sets in between the 2nd and 3rd months.
Different babies may take different amounts of time to warm up and give that first elusive smile. But if your bundle-of-joy has not smiled, say even once in the first twelve weeks, then a pediatrician should be consulted.
By the time the baby is around 8 or 9 months old, the brain and senses have undergone quite a lot of change. Stranger anxiety is a common occurrence during this time. Your formerly friendly baby is likely to stop smiling at strangers. Distinguishing faces is actually a sign of healthy development and developing stranger anxiety is a sign that your baby has started identifying the people close to him/her. This selective smile comes about around the 8th or 9th month.
When the baby finally starts developing language skills, their sense of humour gets better. At this stage, he will recognize and respond to funny things around him. This kind of sense of humour generally takes about 12 months to form and develop.