How far ahead is planning done before a manga is released? The question speaks for itself. I have always wondered how many of these amazing plots just unwind so naturally. Is it done as they go along or do they have separate set sessions for developing ideas, writing etc. Not to answer my question but one would have to assume the latter, I'm just asking how far ahead is said planning usually done.

For example, when Naruto initially started was there ever a plan to have the Akatsuki and Pain or have Jiraiya die?
This answer began as a comment, but quickly grew to large.

I'm purely speculating here, but generally most writers would probably have  chief events planned from the start, and fill in the gaps as they go. By chief I mean turning points that are essential to the story overall. When I say planned I mean they already know what they want to happen, and how to achieve it, or at least have a general idea, and perhaps are leaving the implementation details up for later. 

As a case example, from the beginning Eiichiro Oda already had the ending of One Piece planned out. To this day he hasn't changed this plan, but out of enjoyment of writing the series he continues to fill the gap from commencement to terminus. (See: One Piece#Production - Wikipedia)

That said, nothing would stop a mangaka from totally changing his/her plans and writing something altogether new at any moment. If I remember correctly, Akira Toriyama had no plans for Vegeta to have any more appearances in the manga Dragonball Z after his defeat on Earth. But when he saw the great positive reaction from fans he kept him in for the rest of the series. Toriyama's original plan is not exactly known, but in the least it had to be modified greatly to accommodate the new character.

Another factor would probably be the publishing agencies themselves. Obviously they want to capitalize, and so most often, more is more. If a manga series is doing very well, they'll probably want to extend it, and so many writers are pushed to write beyond there original plans. Continuing with the Dragonball Z example, we can see just that. Toriyama planned to end his work at the defeat of Cell, but was urged on by publishers to continue, which lead to the true climax, Buu.

Also, censorship could play a part in some cases. If something written by an author goes against the standards of either society or the publisher, it would have to be modified, and even a small change can have great consequences later on. This of course must take into account creative control, which is an author-by-author process depending on the details of any given contract.  

Again, all of this is nothing more than pure speculation that uses nothing but perceivable events as evidence. As I find more resources and evidence I'll add it. Perhaps to try to formalize this as it stands, I'd just agree with kuwaly, and say that it's all up in the air. Writers, publishers, public reaction, political correctness and just about anything else could alter the course of any writer's storyline at any point. I doubt any manga ever turns out exactly like the first draft.