We are enslaved by our shame of sex and sexuality in our culture, and this gets passed down to each new generation.
Ideally the child should have enough trust and rapport developed with their parents that they can bring up the subject when THEY are ready to know it. This means basic discussions early on, and a direct answer to any of their questions without batting an eye when they are asked, none of this "when you are older" crap.
Unfortunately an environment of openness and frankness is not one that can be established retroactively, it has to developed throughout childhood, verbally, consciously and subconsciously. None of this hiding their eyes from an exposed tit BS, doing so reinforces an aura of inaccessibility and shame of the subject - they or their friends will find some parents stash of playboys, or online porn and share them anyhow - shielding them is counterproductive. There should be an ongoing dialogue where the child is frequently reminded that they should feel comfortable approaching with any and all questions of this nature. If rapport is established at an early age the child will not be embarrassed or try to get answers elsewhere, instead they will come to you when they are ready.
A child better know the ins and outs (double entendre intended) of the topic prior to middle school, but in all likelihood they have already learned bastardized versions from their friends even in elementary school, which is why they should feel ok coming home and asking you to clarify these schoolyard discussions, and also why there is no age that is too young, it is best to head off misinformation at the pass, not retroactively.
And for gods sake.. it is a MUST that they know full well what it is about prior to being biologically able to reproduce.