I'd give myself at least 4 months if I were you.
But the time necessary to feel really prepared for the test will vary significantly between individuals.
For my first attempt, I studied seriously for only maybe 2 months, and on and off for a month beforehand. For my second attempt I studied very little.
In any case, here is a bit of general advice:
First, make sure you have enough time to familiarize yourself with the material - that is, UNDERSTAND it. Don't simply review it passively.
Secondly, make sure you feel absolutely comfortable taking the test. If you have any doubt in your mind, reschedule.
I speak from experience with this latter piece of advice, my mistake was to go in when I didn't feel mentally prepared.