There are two hadeeth that we can refer on to determine the best time to name your baby.
Rasulallah (s.a.w) said that “Every child is held in pledge for his Aqeeqah which is sacrificed for him on his seventh day, and he is named on it and his head is shaved.”
[‘Saheeh’ by Shaikh al-Albanee ‘1165’ Abu Dawood ‘vol: 2, no: 2831’ and as well others]
The other narration in this aspect is related by Anas (r.a), who said Rasulallah (s.a.w) said “A boy was born to me this night and I have given him the name of my forefather Ibrahim.”
[Saheeh Muslim (4/ 5733)]
Based on these hadeeth, a child can be named on the day of the baby is out to the world or the naming can wait until the baby is seven days old. Besides that, on the baby’s seventh day, Aqeeqah is performed for the baby and it is preferable for the baby’s head to be shaved.
However there are no restriction for you to name your child at anytime. Both times mentioned in the hadeeth are the best and recommended for naming your baby with a good muslim baby names.