It can take anything from weeks to years. My first book took me four years on and off! My second took me a year. Some people write their first draft very quickly and then spend a long time editing. I tend to edit as I go along. So it varies hugely from author to author and book to book.