It depends entirely on the comic.
Grassblades has an outline of all important events from beginning to end, but I only write it - with dialogue and detailed events - as I thumbnail upcoming chapters, and I'm usually about 2 chapters ahead of my readers, so it's an ongoing thing. And in this particular case, it took me 4 years to come up with that general outline, because for some reason it took me that long to come up with who the antagonist should be. I'm looking at a total of maybe 5 years of drawing/posting it, so all in all, about a decade, if you count planning time from "man, I should do a comic about a wandering swordsman, that would be cool". ^_^;
When it comes to shorter oneshot comics (like, 20 pages or less), I can put one together - from vague idea to finished dialogue/thumbnails - in a couple of days if I have to. I'm working on a 24-page oneshot right now that took me about 2 weeks to plan/write, and I just finished the first-draft thumbnails on a comic that will end up being around 90 pages, which took me several months to plan.
So it depends mostly on a.) the intended length of the comic (longer comic = longer planning time), and b.) how much time it takes me to work past any plot-issues or concept art hiccups. Some comics come together very easily, others are a long, slow slog. It varies a lot!