There's no clear answer. You might as well ask how long a piece of string is. The timeframe to go from idea to finished story varies considerably with every single writer out there. But you cannot just snap your fingers and have an idea appear fully formed in your head, ready to write down. If you can, you're a freaking genius... and possibly a wizard.
For most writers, it's the result of long hard work and long hard hours. I get asked a lot how long it took me to write X novel. And in all honestly, I can give several answers. The main bulk of actually writing it takes me usually around a month. Planning it can take several months. Researching can take several years. But all of these are just as important to create the finished product, so where do you draw the line?
I think of it a little bit like an iceberg. We all know the metaphor of the surface being all that you see, but it is true for novels, as with many things in life. The top of the iceberg is the book which readers can pick off the shelves, take home and enjoy. But every single word within that cover has been crafted by hand; every chapter crafted with the utmost care; every detail researched meticulously. The writer has secretly, invisibly, carved the underbelly of the iceberg into the most exquisite thing they can.
Many people are aware of all this work which goes into novel-writing - otherwise there would be no such thing as the question, "How long did it take?" But it can be easy to forget all these other things which go on in the background to make the book what it is. And this includes writers as well.
A lot of people sit down to write their first book and freeze like a rabbit in headlights. We've all been there: staring at the blank document, with the cursor blinking tormentingly, trying to figure out how to begin this mammoth of a task. Everyone is daunted the first time. But the more you write, and the more you figure out what works for you, the easier the process becomes.
Me personally, whenever I get an idea which I know I will turn into a book, I accept that the story won't come to fruition for at least another five years. Many of the stories I have released so far began their journey in my childhood or teens. I only ever write one novel at a time, but I'm always working on another three or four in my head. Just because I'm not writing them down doesn't mean they aren't in progress.
Some writers work in a similar way. Other's don't, and that's absolutely fine. No two people are the same and neither are their preferences for writing a book. There is no wrong way to sculpt your iceberg, and no reason why you shouldn't do it in one year or ten.
But that's just finding your own way of what's best and easiest for you. There is one other important thing which you need to do in order to extend that sculpture to the top of the berg: your willpower to finish what you start.
It's harder than it sounds. For as scary as that first empty page can be, it holds an atmosphere of temptation and excitement. Starting a new story can give you one heck of an adrenaline rush, and you go into it with all guns blazing, living the words as you type them. It's a fantastic state of mind to experience. But everyone has to come down off a high, and after all, a novel is not something you can finish overnight. It can be very easy to lose your motivation halfway through, and either take a hiatus from the manuscript or abandon it altogether.
This point is the test which every writer has to go through, sometimes with every book they write. Do I carry on? That waste paper basket looks very tempting...
But like runners hitting the wall, you need to power through. Writing a book can be mentally strenuous, but the reward and sense of accomplishment at the end is worth every single minute of blood, sweat and tears. It all goes into the beautiful work of art which all your toil under the surface will bring to life.
So the question you should ask yourself isn't so much "How long will it take to write?", but "How much willpower am I willing to give it?"
The way I do it is essentially by simple maths. If you work in chapters, try to write one chapter per day. So, in theory, if you have thirty chapters, a first draft will take you a month to write. And once that part is over and done with, a lot of the pressure will instantly disappear off your shoulders.
As for the rest of the iceberg, I let my mind do its own thing. Putting myself under pressure to get it all figured out straightaway is more of a hindrance than a help. All stories need a chance to grow and explore whatever they are going to address. It's like that nice top you got as a kid but it was a bit too big - you grow into it soon enough, with time, and by not throwing the thing away because it didn't fit on day one.
Don't worry about time. Just concentrate on whatever you need to do to craft your story - however long, short, intricate or haphazard the method might be. You'll have a beautiful ice sculpture to show at the end of it - whether people inquire about the top half or the bottom half!