Polished writing is an indication of your attention to detail. If you don’t know where the commas go—and where they don’t belong—can the reader really trust that you’ll know how to craft a character, maintain consistency in setting, or follow through on tension? Early pages riddled with grammar issues will hinder the reader’s confidence in the writer.
Additionally, poor grammar can make your work difficult to read. If an editor can’t understand your sentences, it won’t matter how vivid the character or how compelling the plot. Give your work the best chance you can. Proofread. Proofread. Then, proofread again.
Many editors certainly do a close edit before sending an issue to the printer. But the story has to make it to that point first. Keep the grammar clean, so readers and editors can focus on the artistry and intrigue of your story.