If you already have the results and you're just writing it up then it should take no more than two weeks. If you intend to do some work that is worthy of publication and then put it into a paper then, from my personal experience, you can't ever say "I'm going to write a paper in the next $n$ months"; it just doesn't work that way.
The fastest I've ever written a paper, from scratch to (successful) submission, is four weeks. I had an idea during a research visit and ran with it. By the time the month was up I'd got as far as I was going with it and was very happy with my results. I wrote it up as I went and submitted it. It was accepted outright.
There are some ideas that I've been struggling with since I was a PhD student, which is back in 2004. I still haven't been able to get anywhere with them and I doubt that I ever will. I keep chipping away, but I just don't have the technical knowledge or the vision to make a breakthrough that is a sufficient contribution to knowledge to warrant publication.
In between that, I have had some nice work that I thought was worth publishing. It took me a long time to write it up. When I finally submitted it, it was accepted subject to revision. I spent a long time trying to iron out the problems that the referee had found and that I had overlooked. It took me the best part of two years to get the article accepted.