The first critical period is at conception when the presence of the SRY gene (Sex-Determining Region of the Y chromosome) will determine our physical gender. The SRY gene is normally found on the short arm of the Y chromosome, but can detach making for a XY female (the Y missing its SRY gene) or a XX male (the SRY attaching to the X).
The SRY gene causes the foetus to release TDF (Testes Determining Factor) which turns the undifferentiated gonad into testes. Once testes have formed, they release androgens such as testosterone, dehydrocorticosterone, and anti-mullerian hormone.