There is no hard and fast rule about when to have your own site up and running, but it will be one of your most expensive ongoing costs of being an author so keep that in mind as you decide.
Some recommend that you have a website even before you begin the submission process for your first novel. Supposedly, those editors and agents will be checking you out when they look at your submission.
This is probably a good recommendation if you are trying to sell nonfiction, and you are an expert on the subject, but I've never heard of an agent or an editor looking up an unpublished author on the web.
Others suggest you set up your website as soon as possible after signing the contract. This will allow you plenty of time to concentrate on the site before you become too busy with other aspects of prepublication.
The last suggestion, and the most common one, is to have the site up just before the book shows up in the bookstores.
My own feelings are that you should have the site up at least four to six months before the publication of your book.
During this period, the publisher will start marketing your book to various distributors, early advance review copies will be sent out for quotes, and a certain amount of buzz will be starting about your book.
If your website is up, you can take advantage of this early period, and you can also improve your book's chances that it will be picked up by major distributors because they will often look at a site to see what kind of promotion the author will offer.