How action potentials regulate myelination by oligodendrocytes is uncertain. We show that neuronal activity raises [Ca2+]i in developing oligodendrocytes in vivo and that myelin sheath elongation is promoted by a high frequency of [Ca2+]i transients and prevented by [Ca2+]i buffering. Sheath elongation occurs ~1 h after [Ca2+]i elevation. Sheath shortening is associated with a low frequency of [Ca2+]i transients but with longer duration [Ca2+]i bursts. Thus, [Ca2+]i controls myelin sheath development.