Neurodevelopmental disorders disproportionately affect males compared to females. The biological mechanisms of this male susceptibility or female protection have not been identified. There is evidence that fetal/neonatal gonadal hormones, which play a pivotal role in many aspects of development, may contribute. Here, we investigate the effects of excess testosterone during a critical period of sex-specific brain organization on social approach and fear learning behaviors in C57BL/6J wild-type mice. Male, but not female, mice treated with testosterone on the day of birth (PN0) exhibited decreased social approach as juveniles and decreased contextual fear memory as adults, compared to vehicle-treated controls. These deficits were not driven by anxiety-like behavior or changes in locomotion or body weight. Mice treated with the same dose of testosterone on postnatal day 18 (PN18), which is outside of the critical period of brain masculinization, did not demonstrate impairments compared to the vehicle group. These findings indicate that excess testosterone during a critical period of early development, but not shortly after, induces long-term deficits relevant to the male sex bias in neurodevelopmental disorders.