Attention deficit hyperactivity disorder (ADHD) medication has proven effective for treating ADHD in adults, nonetheless previous studies have shown high rates of medication discontinuation. To assess drug survival and identify risk factors associated with discontinuation of ADHD medication. A nationwide registry-based cohort study in Danish adults who redeemed a prescription for ADHD medication for the first time between 2010 and 2015. All patients were followed for 5 years from the first redeemed prescription. Discontinuation was defined as a gap of 12 months between redemptions. Logistic regression analysis with odds ratio (OR) and Kaplan Meier analysis were used to examine risk factors (sex, age, socioeconomic status, substance use disorders, and comorbidities) associated with discontinuation. Twenty three thousand nine-hundred and sixteen patients with ADHD were identified. The 5-year overall drug survival was 29% in women vs. 23.5% in men. The risk of medication discontinuation was significantly higher in men compared to women, OR 1.26 (95% CI 1.19-1.34, p < 0.001). Adults aged 31-50 years had a significantly decreased risk of medication discontinuation compared to adults aged 18-30 years, OR 0.57 (95% CI 0.53-0.61, p < 0.001). Switching ADHD medication two times or three times or more significantly decreased the risk of discontinuation; OR 0.53 (95% CI 0.49-0.56, p < 0.001) and OR 0.26 (95% CI 0.23-0.30, p < 0.001), respectively. Substance use disorders and certain comorbidities were associated with medication discontinuation. Eating disorders, OR 0.71 (95% CI 0.64-0.78, p < 0.001), intellectual disabilities, OR 0.65 (95% CI 0.59-0.73, p < 0.001) and sleep disorders, OR 0.42 (95% CI 0.37-0.49, p < 0.001) were associated with continuation of ADHD medication. The 5-year overall drug survival was longer in women compared to men. Women with ADHD; adults aged 31-50; and patients with comorbid eating disorder; intellectual disability; sleep disorder and medication switching were individually associated with continuation of ADHD medication. Various factors were associated with medication discontinuation. Discontinuation should be acknowledged as a common phenomenon in patients with ADHD and calls for increased attention from the treatment responsible prescriber or team. Moreover, our findings suggest that timely, frequent medication switching, or temporary regimens may indeed represent optimal management strategies for a significant proportion of the ADHD population.