*I think with kids that age I would tell them as soon as possible and prepare to give them all the information they ask for, including things you may not want to say. They might ask lots of questions. It's their lives too. Don't try to stonewall, be as open and honest as you possibly can.
Remember to say really clearly that it's your fault (both of you) not their fault - nothing they did caused it and nothing they could have done would have stopped it. And that you both love them completely and unconditionally and always will. Have something concrete to say about when and how they will see their dad (hopefully there won't be any restrictions on them doing that).
It's a hammer blow and it's horrible. I feel for you having to do it. But one thing I've learned (ex and I split up 10+ years ago) is that what you do afterwards is what really counts. Being kind, not having rows, NEVER slagging the other parent off, making their relationship with their dad a huge priority even if it means sacrifices for you. This is how you show them that their well-being is still the most important thing for you, and it's also how you get to forgive yourself. I did, eventually.*
I think this is spot on.
Telling my dc that we were separating was the worst experience of my life. I had discovered the day before that my husband, their beloved dad was having an affair. I asked him to leave that day and told him he had to come back the next day as we were going to tell the children together. There was no way I was doing that on my own after what he had done.
So we told them, we said that we weren't making each other happy any more and had decided that we were going to separate and that he was moving out. We told them it was not their fault, that we both love them very much and they will still see us both a lot. My ex even said that we were still friends, which I could have killed him for as we were far from that.
They were both distraught because the reality is we were happy, at least until very recently to the affair. We were a happy family and we did lots of lovely things together. They saw us care for each other, being affectionate and loving and then suddenly they were being told we weren't happy.
I decided not to tell them the truth about their dad's affair, which was worse for me as I had to outwardly take half the 'blame' for our family being broken, but I decided it was the best thing for the kids. They love their dad and didn't need to know what he had done. They were 10 and 12 when we split.
Anyway, I think they are old enough to have a mature conversation with them but only what they need to know. It's horrible but they certainly won't be the only ones they know who have been through it and hopefully they have lot of love and support around them over the coming weeks. Good luck.