No one minds a grammar error here and there, but that's about it. You'd better hope your agent is intolerant of a lot of errors because editors are definitely intolerant. Editors, not agents, are the ones who have to get the novel ready for publication, and they have very little time to do so.
Not that it usually matters. Writers who aren't pretty darned knowledgeable about grammar and punctuation usually can't write very well, either. Good writing and such knowledge go hand in hand, which is why writers are kidding themselves when they think they can have someone else fix their grammar, and all will be fine. It won't be. Bad stays bad, even when someone else makes the grammar and punctuation perfect.
We all make a grammar error here and there, but if you make very many, if you really aren't very knowledgeable about grammar, it's time to stop writing for a couple of months, and spend that time learning grammar.
Where most agents, and just about all editors, are highly intolerant of grammar and punctuation errors is in query letters. If a writer can't write one or two pages that are error free, what will a one hundred thousand word manuscript be like to edit?
The first several pages of a manuscript are much the same. Errors slip into almost any fill manuscript, but there really shouldn't be any in the first several pages.
Though blackbird nailed it. The great majority of writers either make extremely few mistakes, or they make mistakes on every page or two, and don't even realize it. Those who make a number of grammar mistakes invariably do other things that aren't technically wrong, but that are simply bad writing, such as passive voice, poor sentence construction, etc. The two always occur together.
Anyway, we all make a mistake here and there, but there's a difference between a very occasional mistake, and simply not having a solid grasp of good grammar and punctuation.
This aside, be extremely careful about mistakes in query letters, and in the first chapter of the manuscript. These two places are where any mistakes can kill everything. Get past them, and the agent or editor is probably hooked. At this point, they'll overlook more, though a bunch of mistakes can still stop them from reading more.