LncRNAs are involved in critical processes for cell homeostasis and function. However, it remains largely unknown whether and how the transcriptional regulation of long noncoding RNAs results in activity-dependent changes at the synapse and facilitate formation of long-term memories. Here, we report the identification of a novel lncRNA, SLAMR, that becomes enriched in CA1- but not in CA3-hippocampal neurons upon contextual fear conditioning. SLAMR is transported to dendrites via the molecular motor KIF5C and recruited to the synapse in response to stimulation. Loss of function of SLAMR reduced dendritic complexity and impaired activity-dependent changes in spine structural plasticity. Interestingly, the gain of function of SLAMR enhanced dendritic complexity, and spine density through enhanced translation. Analyses of the SLAMR interactome revealed its association with CaMKIIα protein through a 220-nucleotide element and its modulation of CaMKIIα phosphorylation. Furthermore, loss-of-function of SLAMR in CA1 selectively impairs consolidation without altering acquisition, recall, and extinction of fear memory or spatial memory. Together, these results establish a new mechanism for activity dependent changes at the synapse and consolidation of contextual fear memory.