We didn't have a specific age, but we (I) just kept a good eye on them and noticed how they reacted to me in the nude or undies. At age 2, they knew was nude was - we didn't make an issue of it, kept it as a normal thing that we didn't discuss but when around age 5, one of my boys started doing a double take - that's when I knew it was time to shut the door and explain the concept of knocking!! We've always been pretty lax about some things, like, the kids will walk in on me while I'm going 'potty', and for the longest time, I didn't care, it was no biggie. By the time they were 5, one noticed more than the other, but they both started really realizing that Mommy was naked!! We didn't make a big deal out of it, just explained that from now on when the bedroom or bathroom doors were shut, we had to knock and wait for the person inside to say come in. That rule was meant for everyone, not just mommy.
They've seen me nude a few times over the last couple years - it's gonna happen, but again, I do not make an issue of it and I don't rush or overly react - I just say in a stern but kinda joking voice "Out, Out, Out!! or I'll chop off your head!!" (they've seen Alice in Wonderland so they get a kick out of that - but they do get out and knock!)
I remember when I was around 7-ish, I barged into my moms room for some reason. She was in the process of getting dressed. My mother was the type to NEVER be nude or in undies around me or any of us kids. So she reacted by practically screaming for me to get out. Needless to say, I remember that because she freaked me out with her reaction and unfortunately, I remember it quite vividly to this day!! So when one of our boys walked in on my husband and myself having.....relations, I calmly stopped my husband :-) and asked what he wanted (he was 6 at the time). He has never mentioned it since and since we didn't make a big deal out of it, I think *hope* it will disappear in the recesses of memory not worth remembering!
J.