Ideally, parents should schedule a newborn photo session during the second or first trimester so that the photographer can keep their schedule in mind, and weeks 1-4 of a newborn's life are optimal for capturing the essence of the youngest babies. I had missed out on taking beautiful photos of myself as a newborn because of a preconceived idea about age. That said, every baby is different, and it depends on their individual growth rate, rather than a widespread "rule", whether or not they can safely participate in a true newborn session. Industry rule of thumb is: maternity Portraits are most flattering captured between 26-36 weeks, Newborn Photography Sessions are best conducted within the first 2 weeks from birth, and Mommy and Baby portrait sessions are typically within the first month after the baby is born.
Babies begin to stretch and extend their arms and legs as early as two weeks, making it more difficult for them to cuddle naturally during photos. However, it is possible to create beautiful posed photographs of newborns after two weeks of age, and many photographers (myself included) will photograph babies who are older.
Typically, when a newborn baby is two weeks old or younger, they will spend long periods of time asleep, and will naturally enjoy spending time in the fetal position, which makes them comfortable in newborn poses photographers tend to implement.
More on this topic in this article - What week is best for newborn photography?