Epilepsy is a common neurological disease. Systemic tumors are associated with an increased risk of epileptic events. Paraneoplastic encephalitis related to gonadal teratoma is frequently accompanied by seizures and life-threatening status epilepticus (SE). However, the risk of epilepsy in gonadal teratoma has not been studied. This study aims to investigate the relationship between epileptic events and gonadal teratoma. This retrospective cohort study used the Korean National Health Insurance (KNHI) database. The study population was divided into two study arms (ovarian teratoma vs. control and testicular teratoma vs. control) with 1:2 age and gender-matched control groups without a history of gonadal teratoma or other malignancy. Participants with other malignancies, neurologic disorders, and metastatic brain lesions were excluded. We observed the occurrence of epileptic events during the observation period (2013–2018) and investigated the risk of epileptic events in each gonadal teratoma group compared to controls. In addition, the influence of malignancy and tumor removal was investigated. The final analysis included 94,203 women with ovarian teratoma, 2314 men with testicular teratoma, and controls. Ovarian teratoma is associated with a higher risk of epilepsy without SE (HR, 1.244; 95% CI 1.112–1.391) and epilepsy with SE (HR, 2.012; 95% CI 1.220–3.318) compared to the control group. The risk of epilepsy without SE was higher in malignant ovarian teratoma (HR, 1.661; 95% CI 1.358–2.033) than in benign (HR, 1.172; 95% CI 1.037–1.324). Testicular teratoma did not show significant relations with epileptic events. The risk of epileptic events showed a tendency to decrease after removing the ovarian teratoma. This study found that ovarian teratoma is associated with a higher risk of epileptic events, especially in malignant tumors, whereas testicular teratoma did not show significant differences in epileptic events compared to the control group. This study adds to the current understanding of the association between gonadal teratoma and epileptic events.