The gut microbiome plays a key role in human health and gut dysbiosis is linked to many sex-specific diseases including autoimmune, metabolic, and neurological disorders. Activation of the hypothalamic-pituitary-gonadal (HPG) axis during puberty leads to sexual maturation and development of sex differences through the action of gonadal sex steroids. While the gut microbiome also undergoes sex differentiation, the mechanisms involved remain poorly understood. Using a genetic hypogonadal (hpg) mouse model, we sampled the fecal microbiome of male and female wild-type and hpg mutant mice before and after puberty to determine how microbial taxonomy and function are influenced by age, sex, and the HPG axis. We showed that HPG axis activation during puberty is required for sexual maturation of the gut microbiota composition, community structure, and metabolic functions. We also demonstrated that some sex differences in taxonomic composition and amine metabolism developed independently of the HPG axis, indicating that sex chromosomes are sufficient for certain sex differences in the gut microbiome. In addition, we showed that age, independent of HPG axis activation, led to some aspects of pubertal maturation of the gut microbiota community composition and putative functions. These results have implications for microbiome-based treatments, indicating that sex, hormonal status, and age should be considered when designing microbiome-based therapeutics.