Changes in synaptic connections are believed to underlie long-term memory storage. Previous studies have suggested that sleep is important for synapse formation after learning, but how sleep is involved in the process of synapse formation remains unclear. To address this question, we used transcranial two-photon microscopy to investigate the effect of postlearning sleep on the location of newly formed dendritic filopodia and spines of layer 5 pyramidal neurons in the primary motor cortex of adolescent mice. We found that newly formed filopodia and spines were partially clustered with existing spines along individual dendritic segments 24 h after motor training. Notably, posttraining sleep was critical for promoting the formation of dendritic filopodia and spines clustered with existing spines within 8 h. A fraction of these filopodia was converted into new spines and contributed to clustered spine formation 24 h after motor training. This sleep-dependent spine formation via filopodia was different from retraining-induced new spine formation, which emerged from dendritic shafts without prior presence of filopodia. Furthermore, sleep-dependent new filopodia and spines tended to be formed away from existing spines that were active at the time of motor training. Taken together, these findings reveal a role of postlearning sleep in regulating the number and location of new synapses via promoting filopodial formation.