The best time to start looking for postdoc positions
During your PhD, it’s a good habit to ask yourself what the coolest thing is that you could be doing next. When you realize many new skills are needed, this might point the way to your next postdoc.
You can dramatically increase your chances of getting the postdoc you want if you contact your potential advisor early.
As a PI in the U.S., I would want you reaching out to me at least a year in advance, ideally. Anything under six months is tight.
The PI’s POV
I am constantly trying to plan my group structure and research priorities over the next few years. I absolutely want as much information early to strategize hiring and potentially line up other funding. Occasionally I'm approached by a wonderful candidate just after I've committed to another, and it’s frustrating when that happens. Pay special attention to January and February, which is usually when we make offers to PhD students. I will sometimes hold off on making such an offer if there’s an excellent postdoc to hire instead.
Remember too that many postdoc fellowships have annual or semiannual deadlines, and those applications are usually written in collaboration or coordination with the potential postdoc advisor. That's another reason to start talking early. It can literally make all the difference between funds being available and not. Some fellowships cannot be applied for once you’re hired.
How to approach potential future advisors
These contacts should start as informal conversations: I tell you where I see my lab’s research headed, you tell me about your skills, interests, and goals, and we see if there could be fun projects to work on together. It can be especially convenient to start these conversations at conferences, but it’s also fine to email and propose a brief phone call.
Your PhD advisor is your most powerful ally. Let them know if there’s someone in particular you’d love to work with. (This can happen after your initial conversation, but it can be especially useful for getting on the radar in the first place.) PIs will often write each other to say, "My PhD student (or current postdoc) is amazing. You need to hire them." We love slam dunks like that.
If you’re worried they’ll resist the request, ask your advisor what it would take for them to put in a good word for you. Ask them what skills you most need to focus on to be a desirable candidate. Then I'd communicate your intentions to develop those skills and actually do it. If you’re in this situation of needing to increase your skills, it’s all the more reason to start the process of looking for postdoc positions early.