I've gone through it 3 times. It really depends on the kid I think, but the minute they ask you and are past 8 IMO you shouldn't keep it up. In general the 8-11 yr old range is when all three figured it out, and friends seemed to have the same experience. My step daughter was the only semi-traumatic kid when she found out. She had learned around 9yo or so and heard it from some kids at school and started defending us and went into the whole my parents would never lie to me etc. That one was tough on my wife, my personal take was yea, she was upset but she'll get it as she gets a little older (which she did). My step-daughter has always been a little more creative and has a crazy good imagination so it didn't shock me she was more disappointed.
My two kids, son and daughter both figured it out around 10yo or so, and both had heard it around school and then asked me, so I just didn't lie once they asked me at that age. I had this rule in my head saying by like the 6th grade if they didn't figure it out I was going to tell them just cause in middle school kids can be kinda cruel.
One thing I think makes it harder on kids now is like for my step daughter my wife had used the Santa online, where Santa sends video messages to the kids and is talking to them using their name and you put in stuff that happened during the year and what they want etc so it is wickedly personalized. I think that makes it way harder on kids that have great imaginations since that makes Santa seem so real.