For Prince Harry and Meghan Markle, it was before their child was born. They took up the domains LiliDiana.com and LilibetDiana.com before their second child, Lilibet Diana, was born. Smart move, actually, since the name of their daughter, which by now have already garnered fame around the globe, could be snatched up to be used as domain name by others if they had not secured the domains beforehand.
Securing domains or creating a website for your child actually prepares them for their online presence or digital footprint. It is not just creating domains but also creating Google accounts or social media platforms, for which in the future, once they are old enough and wanted to make use of it, it will be available to them.
However, experts warned to not be too carried away and be cautious with posting pictures or videos in those websites or accounts you have created for your child since they might not approve of those posts when they get older and have a sense of identity for themselves. Remember that these accounts are for future preparation.
In addition to securing the digital future of your child, creating domains or accounts are virtually free, so why not consider it early on.