I think that due to our society most children have an idea and basic understanding at a very young age. I cannot remember a time in my life not knowing about sex and whatnot. With sex education starting in 6th grade here we didn't need the discussion. And again as a freshman in HS, we definitely didn't need our parents to have the awkward conversation with us since our teacher got to instead. I think that as long as you keep an open, trusting relationship with your child, if they have questions they will come to you with them. But with the internet, friends and education in schools, it's pretty unnecessary nowadays.
I was a school nurse in an Elementary school and I can assure you that 5th graders are aware of sex and they talk about it on the playground. So if you want your child to hear it from you instead of on the playground, I would say talk prior to 5th grade. I talked to my daughter in 4th grade, just started with what changes she could expect her body to go through and opened the line of communication so she knew she could ask me anything. I told her not to trust what she heard others say, to ask me and I would verify it or refute it, explain it, whatever was appropriate.