There was even a recent study on this topic, which included 216 infants under the age of 1 year. And already at this young age, it turned out that babies are not able to learn new things and remember new tasks unless they get enough sleep soon afterwards.
This makes it clear that the best time to teach children new things is immediately before bedtime, and it also confirms the importance of reading, such as bedtime stories. Psychologists also point out that this is particularly important in the early years of life rather than later on.
To elaborate on the aforementioned study, the researchers taught infants aged 6-12 months three new tasks by playing with puppets. Half of the babies went to sleep within 4 hours of learning, while the remaining half didn't go to sleep at all or slept less than 30 minutes. The children then repeated the tasks they had learned the next day. And the result was that sleep was absolutely crucial for learning, as the children who did not sleep did not remember any of the tasks, while the children who slept after learning remembered an average of 1.5 tasks.
Source.


