I can answer the question in the title in four words: AS SOON AS POSSIBLE!
I'll break it down a bit, but please keep the following notes things in mind:
Many photographers, myself included, have day jobs to make ends meet. We are not high-end, luxury photographers, and we like keeping our prices at affordable rates so that we can work with wonderful families of all backgrounds. But, that day job takes much of our time, and that should be considered.
Remember the light - the most important part of photography. The best pictures happen at golden hour, which is pretty early in the morning or an hour or so before sunset (timing changes with the seasons and Daylight Savings Time). This is the ideal light for photography; all photographers know this and will fight for this perfect light.
So, between busy work schedules (and all of the other things on our calendars, like volunteering, going to church, spending time with our families and friends, and sleeping) and only so many windows of opportunity for perfect light, scheduling photo sessions can challenging.
This is why I say you should contact your photographer ASAP! It provides the most likelihood that there will be room on the schedule for you. I recommend that my clients reach out to me two months before they want their session to occur. In the fall, I would suggest three month's notice, as this season is a very busy time for photographers who are trying to work with the pre-holiday rush.
Pro tip: If you want your photos back by a certain point (I usually deliver mine less than two weeks after a session), mention that deadline up front in the scheduling process. A photographer like me appreciates knowing those special requests early on, so we can decide if we can honestly honor them. Sometimes editing gets backed up, and I would hate for someone to be waiting for pictures longer than they expect.
For weddings, I would recommend reaching out to your photographer eight months to a year before the wedding date. This allows the couple time to talk with the photographer and go over all the many details of the event. Plus, my couples get a free engagement session, and we need plenty of time to book that!
With all this in mind, please know that photographers understand that things come up. I've done many photo sessions with only a week's notice. I've done weddings with only three month's notice. Please, NEVER be afraid to reach out. But, know that the earlier you get in contact with me (or any photographer), the better your likelihood of getting the perfect date set on the calendar!
I hope you found this helpful! For more tips, go to my FAQ page.