Methylation is a chemical modification of DNA and other molecules that may be retained as cells divide to make more cells. When found in DNA, methylation can alter gene expression. In this process, chemical tags called methyl groups attach to a particular location within DNA where they turn a gene on or off, thereby regulating the production of proteins that the gene encodes. In the mammalian genome, DNA methylation is an epigenetic mechanism involving the transfer of a methyl group onto the C5 position of the cytosine to form 5-methylcytosine. DNA methylation regulates gene expression by recruiting proteins involved in gene repression or by inhibiting the binding of transcription factor(s) to DNA. During development, the pattern of DNA methylation in the genome changes as a result of a dynamic process involving both de novo DNA methylation and demethylation. As a consequence, differentiated cells develop a stable and unique DNA methylation pattern that regulates tissue-specific gene transcription. In this chapter, we will review the process of DNA methylation and demethylation in the nervous system. We will describe the DNA (de)methylation machinery and its association with other epigenetic mechanisms such as histone modifications and noncoding RNAs. Intriguingly, postmitotic neurons still express DNA methyltransferases and components involved in DNA demethylation. Moreover, neuronal activity can modulate their pattern of DNA methylation in response to physiological and environmental stimuli. The precise regulation of DNA methylation is essential for normal cognitive function. Indeed, when DNA methylation is altered as a result of developmental mutations or environmental risk factors, such as drug exposure and neural injury, mental impairment is a common side effect. The investigation into DNA methylation continues to show a rich and complex picture about epigenetic gene regulation in the central nervous system and provides possible therapeutic targets for the treatment of neuropsychiatric disorders.