The development and stabilization of neuronal circuits are critical to proper brain function. Synapses are the building blocks of neural circuits. Here we examine the effects of the neuropeptide oxytocin on synaptic transmission in L2/3 pyramidal neurons of the barrel field of the primary somatosensory cortex (S1BF). We find that perfusion of oxytocin onto acute brain slices significantly increases the frequency of miniature excitatory postsynaptic currents (mEPSC) of S1BF L2/3 pyramidal neurons at P10 and P14, but reduces it at the later ages of P22 and P28; the transition occurs at around P18. Since oxytocin expression is itself regulated by sensory experience, we also examine whether the effects of oxytocin on excitatory synaptic transmission correlate with that of sensory experience. We find that, indeed, the effects of sensory experience and oxytocin on excitatory synaptic transmission of L2/3 pyramidal neurons both peak at around P14 and plateau around P18, suggesting that they regulate a specific form of synaptic plasticity in L2/3 pyramidal neurons, with a sensitive/critical period ending around P18. Consistently, oxytocin receptor (Oxtr) expression in glutamatergic neurons of the upper layers of the cerebral cortex peaks around P14. By P28, however, Oxtr expression becomes more prominent in GABAergic neurons, especially somatostatin (SST) neurons. At P28, oxytocin perfusion increases inhibitory synaptic transmission and reduces excitatory synaptic transmission, effects that result in a net reduction of neuronal excitation, in contrast to increased excitation at P14. Using oxytocin knockout mice and Oxtr conditional knockout mice, we show that loss-of-function of oxytocin affects baseline excitatory synaptic transmission, while Oxtr is required for oxytocin-induced changes in excitatory synaptic transmission, at both P14 and P28. Together, these results demonstrate that oxytocin has complex and dynamic functions in regulating synaptic transmission in cortical L2/3 pyramidal neurons. These findings add to existing knowledge of the function of oxytocin in regulating neural circuit development and plasticity.