Answer
The SRY genes on the Y chromosomes in males is responsible for the development of gonads into testes males.
Work Step by Step
The hormonal medium in this process is an androgen, specifically dihydrotesterone(DHT). DHT stimulates the male gonads to differentiate into teastes. There are no SRY genes on female X chromosomes , so no androgens are produced, so ovaries rather than testes develop from gonads. It is the absence of androgens, not the presence of estrogens, that permits development of ovaries.
The full mechanism of testes differentiation is not completely clear . It involves a cascade of reactions that include actions by the SRY protein Mullerian duct inhibiting substance (MIS, human chorionic gonadotropin (hCG), testosterone , and dihydrotesterone (DHT).