Routine is very important to writing a book because you need to have a schedule. Having a schedule helps you be more consistent in your writing and helps you reach your goals. Mostly, you need time for your writing, a goal for every “session” and an end goal.
As a middle school student, I went to school from 8:00 am - 3:30 pm and I would write my books at night with my other friend from 9:30 am - 11 pm. Now, in high school, I go to sleep extremely early (8:30 pm) and wake up extremely early (2:30 am). All this is getting to that that your routine doesn’t have to be written in stone. You can change your routine to fit your schedule so you have time for it without it interfering with your other occupations or activities.
Second is your goal. For every session, there's a goal you should try to reach so that you finish your book on time (if you have a deadline) or so that you don't just write one word and procrastinate. Usually, you would measure your goal by words—not by pages because of the different fonts and sizes, and not by paragraphs because all paragraphs have different sizes.
Finally, you need your end goal. Your end goal mostly depends on who your book is recommended for. If it is a novel for teens and above, its usually about 80,000 words. For picture books, it would probably be about 500 - 1,000 words.