How important is grammar to a writer? That's like asking how important water is to a fish. Yet you might be surprised by the number of writers that don't take it serious enough. Considering there are agents and editors out there who will shape and change your book, how important is it really though? How much editing can you expect an agent, and especially an editor to do? You might not like the answers.
Grammar is to your novel what air is to you. Without it your novel cannot breathe. Agents get thousands of submissions every month. With such a high volume they are looking for two things. The first of which is a reason to reject your work. The second is outstanding writing. Because of that first reason, good grammar is vital to your chances of getting out of the slush pile. Agents may help with minor grammar if your writing is powerful enough and your story is compelling enough.
The English language is one of the hardest languages in the world. With words like their, they're, there and reign, rain, or rein it's easy to see how someone could get confused. And those are just the tip of the iceberg as all writers know (no, now?!). What are you to do if grammar isn't exactly your strong point? If you can take a class or two on grammar or composition do so. Don't have the time or money? Then pick up a book on the subject or borrow your kids English text book. Find a critique group that is willing to help.
Another idea is to hire a freelance editor. Don't just rely on them for every novel. Analyze and learn from what they do to your manuscript. Just like agents, when it comes to the point where your manuscript is put before an editor of a publishing house, they will expect it to be polished and professional. If it isn't they may lean toward another novel in their pile that is.
Want more advice on grammar? Check out these posts from Writer's Digest: How To Handle Animal Pronouns, Don't Use Adverbs & Adjectives To Prettify Your Prose and Reign Vs. Rein. Any more tips out there anyone wants to share?