Question: When do you become genetically male or female?
Answer: fertilization
Natural Questions answer: at the time of fertilization (from the Wikipedia article "Sexual differentiation in humans")