Engram cells are formed during learning and store memory information. However, little is known about the modulation of engram cells on time-dependent memory flexibility. Employing a male mouse model, we demonstrated that a temporal factor dictates the memory state, driving either pattern separation or pattern completion. Reengagement of engram cells in the dentate gyrus (DG) during memory retrieval in altered contexts was higher during pattern separation than during pattern completion, concomitant with a time-dependent reduction in synaptic transmission. Specific activation of DG engrams promoted pattern separation, whereas their inhibition accelerated pattern completion.