O-GlcNAcylation is a reversible co-/post-translational modification involved in a multitude of cellular processes. The addition and removal of O-GlcNAc modification is controlled by two conserved enzymes, O-GlcNAc transferase (OGT) and O-GlcNAc hydrolase (OGA). Mutations in OGT have recently been discovered to cause a novel Congenital Disorder of Glycosylation (OGT-CDG) that is characterized by intellectual disability. The mechanisms by which OGT-CDG mutations affect cognition remain unclear. We manipulated O-GlcNAc transferase and O-GlcNAc hydrolase activity in Drosophila and demonstrate an important role of O-GlcNAcylation in habituation learning and synaptic development at the larval neuromuscular junction.