If you're writing a children's book, it pays to be familiar with how publishers classify them. Publishers generally assign age groups for readers of various formats as set out in the following list:
Board books: Newborn to age 3
Picture books: Ages 3–8
Coloring and activity (C&A) books: Ages 3–8
Novelty books: Ages 3 and up, depending on content
Early, leveled readers: Ages 5–9
First chapter books: Ages 6–9 or 7–10
Middle-grade books: Ages 8–12
Young adult (YA) novels: Ages 12 and up or 14 and up
It's okay to veer off a year or so in either direction when assigning a target audience age range to your work.