Epidemiological evidence has demonstrated associations between sleep and epilepsy, but we lack a mechanistic understanding of these associations. If sleep affects the pathophysiology of epilepsy and the risk of seizures, as suggested by correlative evidence, then understanding these effects could provide crucial insight into the basic mechanisms that underlie the development of epilepsy and the generation of seizures. In this Review, we provide in-depth discussion of the associations between epilepsy and sleep at the cellular, network and system levels and consider the mechanistic underpinnings of these associations. We also discuss the clinical relevance of these associations, highlighting how they could contribute to improvements in the management of epilepsy. A better understanding of the mechanisms that govern the interactions between epilepsy and sleep could guide further research and the development of novel approaches to the management of epilepsy.