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