Definitely teach them the facts throughout their childhood. This should include the mechanics and uses of sex, and also moral direction. When they become teenagers they will do what they want regardless of what you've taught them.
Do keep the dialog going even after they are adults.