Every single book is different. Anywhere from 2 months to ten years. However.....
Generally I let a book gestate for a while before it goes "live." Often a year or more, playing with ideas and doing sketches and bits of exploratory writing in my spare time -- but mostly just letting it cook in the back of my mind.
The actual writing of the story varies a lot, but generally, I write the exploratory draft, first draft and second draft all in one draft -- I like to fit my stories together like a puzzle with fine honed pieces. This is why it is so variable. Some stories are pretty straight forward others are more difficult.
But generally, when the story takes a long time, it doesn't actually take more hours to complete, it's just that I have to set it aside and let it cook more. If I were to put the hours worked back to back, I suspect most of those novels would all take a similar amount of time to write -- two to three months of part time labor.
Once it's done, the rewrite doesn't take all that much effort, although that too may take a lot of calendar time, as I set it aside to work on other things. So while it might take a week or two of actual work (and maybe another week of polishing) that work might be spread over another couple of months to a year. That part of the process, however, can usually be hurried up if I need to, because it's more practical and rational.
Camille