External stimuli contribute to the neuronal properties partly through regulating gene expression. Previous works have shown nuclear infolding induced by external stimuli and pathological conditions in neurons. However, the dynamics and reversibility of the changes in nuclear shape upon external stimuli have been unknown. In this study, we found that the nuclear shape of excitatory neurons in the visual cortex altered and undergo invagination upon visual stimuli. Subsequently, we performed time-lapse imaging of the nuclear shape of excitatory neurons in the visual cortex using Nex-Cre;SUN1-GFP mice, labeling the nuclear membrane of excitatory neurons with GFP. We found that nuclear infolding can be observed within the first 15 minutes of light exposure. Depletion of the stimuli by finishing the light exposure or injection of MK-801, an inhibitor of NMDA receptor, restored the nucleus to a spherical shape and reduced the dynamic behavior, suggesting that nuclear infolding in neurons is reversible process. Then, as brain function declines naturally over age, we also examine the nuclear shapes of neurons in aged mice. In contrast to young mice, the nuclear shape in aged mice showed less dynamic change upon light stimulation. In conclusion, our data highlights the changes of the nuclear shape upon visual stimulation and its potential role in the response towards external stimuli and the dysfunction of the aged brain.