Activity-dependent plasticity is a critical component of nervous systems. We show that in Caenorhabditis elegans, worms raised in isolation made smaller responses to mechanosensory stimulation and were smaller and slower to begin laying eggs than age-matched group-raised worms. The glutamate receptor gene GLR-1 was critical for the observed alterations in behavior but not in size, whereas the cGMP-dependent protein kinase gene EGL-4 was critical for the observed changes in size but not the changes in behavior. Mechanosensory stimulation during development reversed the effects of isolation on behavior and began to reduce the effects of isolation on size. In C. elegans, the six mechanosensory touch neurons synapse onto the four pair of command interneurons for forward and backward movement. Touch (mechanosensory) neurons of worms raised in isolation expressed lower levels of green fluorescent protein (GFP)-tagged synaptobrevin than touch neurons of worms raised in colonies. Command interneurons of worms raised in isolation expressed lower levels of GFP-tagged glutamate receptors than command interneurons of worms raised in groups. Brief mechanical stimulation during larval development rescued the expression of GFP-tagged glutamate receptors but not GFP-tagged synaptobrevin. Together, these results indicate that the level of stimulation experienced by C. elegans during development profoundly affects the development of neuronal connectivity and has widespread cellular and behavioral consequences.