As others have said, there is of course no one answer to this, but so, so much of this depends on the reaction of both parties. I am hugely skeptical when we see posters on here who are immediately sure they want to save their marriage and convey that to the cheater up front. I know in my case, I had such a strong instinct that my DH had to feel every last consequence of his choices (and they are choices, not "mistakes" - I pulled him up every single time he used that word) to have any chance of being a decent human being, let alone a possible husband any more. And the cheater will go through stages of reaction, so for me it was important to know that he wasn't just panicking when he was saying that he wanted to save the marriage, would do anything, etc.
I kicked my DH out the day I found out, went really scorched earth no contact, and it still took about a year apart and him showing unstinting commitment to me, our marriage and really feeling actual love from him again. It also can't be overstated how much the kicking out option aided my self-esteem, so that I could get to a place (aided by therapy) that I could be confident I wasn't making choices out of weakness and fear. (To the point that, when I made the decision to reconcile, I was really weighing up how much I had enjoyed parts of being single!)
My DH started therapy for himself and begged me to do couples counselling for about 9 months before I agreed. He showed up every single time he was supposed to for the children and never faltered in showing he wanted to be together.
It's my opinion that so much of cheating (except perhaps for the classic exit affair) is about entitlement, at least in the middle-aged, middle class, circles we move in, and I knew I had to kick that out from under him and own my part in allowing him to feel that way. I had to remind him that I exist as a separate person and really make him see me. It also helped when his therapist told him straight out that she didn't think his cheating had much, if anything, to do with me or our marriage. You could almost see the entitlement seep out of him over the course of the year. Hard to explain, but true.
Anyway, this is just my story, but it's also a caution from me about being sure one wants to save or leave a marriage immediately. How can you possible know until you see how the cheater comes to terms with what's happened? You just can't see that in the immediate, panicked, traumatised aftermath. It strikes me as virtually impossible. We may all wish to keep our family intact or to walk off with our head held high, but at least in my case I was terrified of making a mistake either way, particularly with children involved. I believe the best advice is often the hardest one to take: When you're not sure, sit and wait and see. It usually becomes much clearer, but one has to sit in an uncomfortable place for a while, which is not great fun.