I start talking about sex in one way or another starting very young, when I'm bathing my kids at very young ages. At that age, I talk about how our bodies belong to ourselves and no one has a right to touch them in a way they don't like.
By the time they were 4, both of my kids asked questions and got enough answers to know everything about where babies come from. My 4-year-old has a copy of It's Not the Stork that we've read repeatedly.
My older one got It's So Amazing by about 6, and then It's Perfectly Normal around 10. We talk about sex and sexuality on a regular basis starting from a young age and add information as it becomes relevant/as they can understand it.
It's important to me to talk about sexuality and gender pretty young so that if a child of mine is LGBT that they'll know what it is and know they're loved and supported in our family as they are. There are kids books about different kinds of families that can introduce that topic. "A family can have two moms or dads?"
I don't have a rule about specifically when, but my general feeling is that earlier is better than later, and I follow their questions.
Does anyone have any strong feelings about what age is right for different kinds of discussions about sex and sexuality?