Do we book dinner times before the cruise or once we get on the ship?
I assume that you have selected My Time Dining and want to book reservations for that? This can sometimes be done before you get on the ship in your cruise planner, but also can be done on the ship during embarkation day by going to the dining room on the ship.
When availability to book opens seems to vary depending on the ship and the sailing, it can be anywhere from 6 months to 60 days in advance. You will have the most availability as far as what time you want to dine if you book these reservations online in advance. That being said don't panic if it shows all the reservations are not available of online booking,. Just head to the dining room during the first day of your cruise to sort out your reservations.
One other thing, it is also possible to dine with My Time Dining without making reservations if you aren't sure when you want to dine, but you will be subjected to a much longer wait time depending on what time you make it down to the dining room that evening.