I'll sum it up like this: He planned it on notebooks when travelling, and spent 7 years revising and editing it. The original however was very 'stream of consciousness' - it was written in continuous form in just 3 weeks.
Obviously when you are trying to publish a 120 foot long scroll, some editing is needed. As for the planning, there didn't seem to be much.
During 1947 and 1950, Kerouac went on his travels that the book tells us about. He wrote about the trips in small notebooks in which a lot of the text was written.
He first started writing the novel in 1948 beaded in his 1947 travels. However he wasn't satisfied.
He was inspired to write the long script when he received a 1000 word letter that rambles on from Neal Cassady, a great friend, he decided to write the novel as if it was a letter.
The first draft was written in three weeks in 1951. It was the continuous 120 foot scroll that has become so famous.
After this Kerouac continued to edit and delete sections of the manuscript to replace them with shorter passages, so there was some editing. He rewrote many parts and there was an unfortunate incident where a dog mistook part of the scroll for homework.
There was an estimated 6 drafts between 1951 and 1957, as his work was constantly rejected by his publishers.
There were several inserts that weren't included in On the Road, and were put in another novel Visions of Cody
On the Road was finally published in 1957, based on revisions of the 1951 scroll.
The major edits were the fact that it was shorter and the main characters had pseudonyms.
Sources: NPR and Wikipedia