Exposure to stress during early life (infancy/childhood) has long-term effects on the structure and function of the prefrontal cortex (PFC), and increases the risk for adult depression and anxiety disorders. However, little is known about the molecular and cellular mechanisms of these effects. Here, we focused on changes induced by chronic maternal separation during the first 2 weeks of postnatal life. Unbiased mRNA expression profiling in the medial PFC (mPFC) of maternally separated (MS) pups identified an increased expression of myelin-related genes and a decreased expression of immediate early genes. Oligodendrocyte lineage markers and birthdating experiments indicated a precocious oligodendrocyte differentiation in the mPFC at P15, leading to a depletion of the oligodendrocyte progenitor pool in MS adults. We tested the role of neuronal activity in oligodendrogenesis, using designed receptors exclusively activated by designed drugs (DREADDs) techniques. hM4Di or hM3Dq constructs were transfected into mPFC neurons using fast-acting AAV8 viruses. Reduction of mPFC neuron excitability during the first 2 postnatal weeks caused a premature differentiation of oligodendrocytes similar to the MS pups, while chemogenetic activation normalised it in the MS animals. Bidirectional manipulation of neuron excitability in the mPFC during the P2-P14 period had long lasting effects on adult emotional behaviours and on temporal object recognition: hM4Di mimicked MS effects, while hM3Dq prevented the pro-depressive effects and short-term memory impairment of MS. Thus, our results identify neuronal activity as a critical target of early-life stress and demonstrate its function in controlling both postnatal oligodendrogenesis and adult mPFC-related behaviours.