Thymus plasticity following gonadectomy or sex hormone replacement has long since exemplified sex hormone effects on the immune system in mammals and, to a lesser extent, in ‘lower vertebrates’, including amphibians and fish. Nevertheless, the underlying physiological significances as well as the ontogenetic establishment of this crosstalk remain largely unknown. Here, we used a teleost fish, the European sea bass, Dicentrarchus labrax, to investigate: (1) whether the regulation of thymus plasticity relies on resource trade-off with somatic growth and reproductive investment and (2) if the gonad–thymus interaction takes place during gonadal differentiation and development. Because gonadal development and, supposedly, thymus function in sea bass depend on environmental changes associated with the winter season, we evaluated thymus changes (foxn1 expression, and thymocyte and T cell content) in juvenile D. labrax raised for 1 year under either constant or fluctuating photoperiod and temperature. Importantly, in both conditions, intensive gonadal development following sex differentiation coincided with a halt of thymus growth, while somatic growth continued. To the best of our knowledge, this is the first study showing that gonadal development during prepuberty regulates thymus plasticity. This finding may provide an explanation for the initiation of the thymus involution related to ageing in mammals. Comparing fixed and variable environmental conditions, our work also demonstrates that the extent of the effects on the thymus, which are related to reproduction, depend on ecophysiological conditions, rather than being directly related to sexual maturity and sex hormone levels.