Immediately, starting right now. I'm aware that this answer is dire and intimidating, so let me elaborate. Many writers consider themselves introverts. They'd much rather sit quietly on their own and hone their writing to the finest point that they can. They can figure out that scary, weird "marketing" stuff later, right? They hope, against all odds, that their story will attract readers later simply by being well-written... This is not the case.