How early or how late to have a baby?

Do you guys think having kids at age 22 is too young? And what is too old to have a baby? Is 40 too old? What age is just right ?