First of all, make sure to check whether you even need to submit a separate ‘written application’ for the course you’re applying for. Most universities only require you to apply for the course via the state-specific admissions centre; the only two universities that really require a separate written application to be submitted are James Cook University (JCU) and the University of New South Wales (UNSW). For more information about this, please refer to this article.
You definitely shouldn’t leave it to the last minute—especially for the JCU application, which allows you to submit three reference letters along with your application (more information about that in this article) and which is actually a very significant factor in the university’s decision-making process when making interview and course offers (refer to this page for more about this), we would recommend that you try to wrap up writing your application during the summer holidays before Term 1 of the year in which you’ll be applying. If you’ve already missed that golden opportunity, then the next best time is immediately after the UCAT.
You absolutely should not leave it until 1 or 2 months before the deadline, as the application is not something that can be whipped up at the last minute. It’s not easy to write a good application, especially if you’re trying to do it in August and September, since you’ll have lots of tests going on at school—not only will you not do a good job, but you’ll also end up having to sacrifice time that you should be spending on other things. You need to allow enough time to review what you’re written multiple times—remember, it’s not a CV, so it needs to be a proper written piece answering the questions asked by the medical school in full sentences, not just a list of dot points!