For everyone this is actually going to vary because each wedding is unique, some are planned very quickly and others are a long process. Your own time-frame will be the ultimate decider. I'd just like to offer a guideline from my own experience.
Generally speaking the earlier you can get your choice of photographer locked in the better. Especially if you're planning a wedding during peak seasons. On the Sunshine Coast/Queensland that's Autumn(March, April, May) & Spring(September, October, November) I would suggest you book between 6 to 12 months ahead. This may seem a bit extreme however most photographers in high demand are booked out in peak seasons anywhere between 3-12 months ahead.
If booking 6 to 12 months ahead doesn't sound suitable for you most couples 3 to 6 months prior to your wedding day is usually the most common time-frame to have your wedding photographer secured. It's generally not too early or too late for most couples since the venue is booked and the final date is set at this point.
Less than 3 Months starts becoming a gamble. That's not to say you can't find a great wedding photographer in that period but you're chances of finding a photographer you love that is available within 3 months or less becomes lower.
This is just a guide from seeing the way my couples have booked in the past. You can book whenever you want to. Just keep in mind peak seasons will make securing your photographer more urgent.