Ideally sometime from January through April of the year you plan to apply. That timing gets your official score back well before AMCAS opens for submission in late May or early June, and it still leaves room for a retake if needed before your application effectively goes cold in a rolling-admissions system.
Take it only after you've finished biology, general chemistry, organic chemistry, physics, biochemistry, and introductory psychology and sociology coursework. Sitting for it just to "see how it goes" without finishing that content base is one of the more common avoidable mistakes we see, since the score is permanent on your record regardless of how prepared you actually were.