The best time to identify a prospective agent is before you need one.
I met my agent, Rita Rosenkranz, at the 2000 Columbus Writer's Conference. Though I was not seeking representation at the time, I was screening prospective agents. I attended Rita's sessions and was impressed with her no-nonsense approach. Three years later when I needed an agent, I called Rita.
Well before you've finished your book, attend conferences, publishing luncheons—anywhere an agent will be speaking. After a couple of sessions, you'll get an idea of what you want in an agent, and you can gauge a prospective agent's passion for your type of writing—and the agent's receptivity to developing writers—by hearing the agent respond to questions.
The time to start the process is now.