Long noncoding RNAs (lncRNAs) play crucial roles in maintaining cell homeostasis and function. However, it remains largely unknown whether and how neuronal activity impacts the transcriptional regulation of lncRNAs, or if this leads to synapse-related changes and contributes to the formation of long-term memories. Here, we report the identification of a lncRNA, SLAMR, which becomes enriched in CA1-hippocampal neurons upon contextual fear conditioning but not in CA3 neurons. SLAMR is transported along dendrites via the molecular motor KIF5C and is recruited to the synapse upon stimulation. Loss of function of SLAMR reduces dendritic complexity and impairs activity-dependent changes in spine structural plasticity and translation. Gain of function of SLAMR, in contrast, enhances dendritic complexity, spine density, and translation. Analyses of the SLAMR interactome reveal its association with CaMKIIα protein through a 220-nucleotide element also involved in SLAMR transport. A CaMKII reporter reveals a basal reduction in CaMKII activity with SLAMR loss-of-function. Furthermore, the selective loss of SLAMR function in CA1 disrupts the consolidation of fear memory in male mice, without affecting their acquisition, recall, or extinction, or spatial memory. Together, these results provide new molecular and functional insight into activity-dependent changes at the synapse and consolidation of contextual fear.