I think Angelo is right in broad strokes. For minor errors it's annoying to bother the editor and the referee. But if it's something that the referee might end up wasting hours on then correcting it pre-emptively makes sense. Here are some examples of things that I'd wait or not on for concreteness. I'd love to hear from people with more knowledge/experience about whether this is vaguely the right place to draw the line.
Wait when:
- An example is incorrect
- A table has some wrong entries
- A technical assumption is missing in the statement of a lemma, but everywhere the lemma is used the assumption holds
- You say something's you've constructed is unique, but really it's only unique up to complex conjugation.
- You're proving some result subject to several technical assumptions, turns out you forgot to include a technical assumption that's no worse than the others.
Contact immediately when:
- A result (not just a lemma) in the paper is completely wrong
- A result in the paper may be correct, but the proof is unfixable
- A section needs to be removed or added
- A construction you use doesn't work, it needs to be replaced by a rather different construction.