Most photographers have limited availability and work on a first come-first serve basis. So the earlier you can book the better. Though, keep in mind, many photographers won't book a couple who doesn't have a venue yet. Their concern is a possible change in the wedding date due to venue availability and, since most photographers do not take on more than one wedding a day, date changes are incredibly difficult to accommodate.
Okay, you have a venue booked and you're ready to finalize a photographer, but you're years away or perhaps just a few months out from your date. Honestly, I’ve had weddings book two years in advance. I’ve also had weddings book just a couple months before. A lot of it depends on your timeline for wedding planning, whether you have a short or long engagement. There is really no right or wrong answer as to when to book. Though booking your photographer closer to your wedding date may limit your options based on what photographers are still available.
Most photographers book weddings about a year in advance, so their calendars for the following year fills up quickly. Again, remember that wedding photographers book on a first come, first serve basis and do not hold dates without a contract and retainer, so once you find the one who's a great fit for you. Don't wait, book them!
Not sure if they're the right fit? Definitely meet with them or at least chat on the phone! It is so important to really connect with your photogapher, after all you'll be spending most of your wedding day with them. Consider scheduling an engagement session with them. It will give you an opportunity to get to know them, see how they work, and see if they're the right photographer for you.