I don't think there is a specific number of hours. From my experience I think it is really important to shadow a variety of optometrist. I shadowed...
an optometrist that was employed by an optical
an optometrist at lenscrafter
an optometrist working in a group practice with other ODs and ophthalmologist
and an ophthalmologist and OD working together at an office at the hospital
I found it was really useful at interviews to talk about these different experiences and knowing how these ODs work days differed and how they were similar. Most of these were just one times encounters and one doctor I worked with for two weeks.
My advice to you is to try to get a job with an OD (it'll help for recommendation letters and experience) and also visit different types of offices and shadow as many doctors as possible even if it is for a couple of hours.