Written English comes in many varieties. When people write like they speak, their written language is more or less a transcription of what they say orally. When they write the kind of formal expository prose that is usually required for PhD dissertations, they write a variety that normally follows rules that speakers don't follow when they speak. This frequently yields stuffy, stilted prose -- what's often derisively called academic prose, and represents the worst side of the language: verbose, boring, complex, pretentious, and just plain undecipherable (cf. postmodernist parlance) -- or clear, easy-to-grok prose. Formal written English is a separate language only in the sense that it must conform to rigid rules laid out in great and sometimes confusing and conflicting detail and arbitrary rules in style manuals -- and not all style manuals agree.
All the grammar anxiety about language comes from confusing the spoken and written forms. Although they are essentially the same language, they are different varieties and require some different skills, and proficient speaking doesn't guarantee proficient formal writing (and vice versa). I remember reading somewhere that Thomas Jefferson wasn't a good speaker. He certainly was an excellent writer of formal expository prose, though.
The language taught in textbooks is a written language and usually artificial. When I studied German, I was assured that what my textbooks taught me was something called "Schuldeutsch", a language found only in textbooks and not on the lips of native speakers of German. When I studied Japanese, I was assured that my textbooks were teaching me something called "Nihongo" and not the everyday language spoken by the Japanese in Japan. When I started teaching English as a foreign language, I decided that the textbooks I was using were teaching students an artificial variety of English -- and listening to the tapes and CDs that accompanied those texts confirmed how phony that variety of English was, so I started writing all my own materials using my idiolect and using "authentic" English as spoken and written by other native speakers (TV news reports mostly).
The other answers provided here are excellent. I especially like John Lawler's sentence "... we might even think of English writing as corresponding to a dialect of English that has not been spoken anywhere since around 1500." That just about sums up the difference between spoken and written English. Most of us don't speak like we write or write like we speak. Speaking is natural and a naturally acquired skill; writing is an unnatural act and mechanical and "must be carefully taught".