Well you have loads of time but don't be complacent and utilize it well. The sooner you clear off this GMAT hurdle the better but don't rush either.
When you think you are sufficiently prepared and ready to give your best, write it. Also you would get to know in advance if you need to retake or you got the score you wanted.
Also writing good application essays takes time. you need to research about colleges. The better you know about the program requirements and offerings, the better you would be able to choose.
So in my opinion.. write it whenever you feel comfortable.. get a good score and focus on other aspects of you BSchool candidacy.. GMAT is just one of the things.
PS: Please consider kudos if you found this useful