When they ask, and depending on your child's maturity level no later than 9 or 10. I only say this now, about 2 years ago I would of said 13, but I know a 13 year old that got pregnant so ..... yeah 9 or 10, at the latest!
In our house, it is on going conversation. My 4 year old already knows the difference between boys/girls and uses correct terms. We have also discussed good touch/bad touch and what to do IF ANYONE touches badly. We will always keep the conversation open and comfortable.