Memory consolidation occurs in two primary stages: synaptic consolidation and system consolidation. Synaptic consolidation happens within hours of learning and involves the strengthening of synaptic connections. System consolidation involves the reorganization of memories from the hippocampus to the cortex, which can take days to years to complete.