Background: The clinical impact of the functional CYP2C19 and CYP2D6 gene variants on antidepressant treatment in people with depression is not well studied. Here, we evaluate the utility of pharmacogenetic (PGx) testing in psychiatry by investigating the association between the phenotype status of the cytochrome P450 (CYP) 2C19/2D6 enzymes and the one-year risks of clinical outcomes in patients with depression with incident new-use of (es)citalopram, sertraline, or fluoxetine. Methods: This study is a population-based cohort study of 17,297 individuals who were born between 1981 and 2005 with a depression diagnosis between 1996 and 2012. Using array-based single-nucleotide-polymorphism genotype data, the individuals were categorized according to their metabolizing status of CYP2C19/CYP2D6 as normal (NM, reference group), ultra-rapid- (UM), rapid- (RM), intermediate- (IM), or poor-metabolizer (PM). The outcomes were treatment switching or discontinuation, psychiatric emergency department contacts, and suicide attempt/self-harm. By using Poisson regression analyses, we have estimated the incidence rate ratios (IRR) with 95% confidence intervals (95% CI) that were adjusted for covariates and potential confounders, by age groups (<18 (children and adolescents), 19–25 (young adults), and 26+ years (adults)), comparing the outcomes in individuals with NM status (reference) versus the mutant metabolizer status. For statistically significant outcomes, we have calculated the number needed to treat (NNT) and the number needed to genotype (NNG) in order to prevent one outcome. Results: The children and adolescents who were using (es)citalopram with CYP2C19 PM status had increased risks of switching (IRR = 1.64 [95% CI: 1.10–2.43]) and suicide attempt/self-harm (IRR = 2.67 [95% CI; 1.57–4.52]). The young adults with CYP2C19 PM status who were using sertraline had an increased risk of switching (IRR = 2.06 [95% CI; 1.03–4.11]). The young adults with CYP2D6 PM status who were using fluoxetine had an increased risk of emergency department contacts (IRR = 3.28 [95% CI; 1.11–9.63]). No significant associations were detected in the adults. The NNG for preventing one suicide attempt/suicide in the children who were using (es)citalopram was 463, and the NNT was 11. Conclusion: The CYP2C19 and CYP2D6 PM phenotype statuses were associated with outcomes in children, adolescents, and young adults with depression with incident new-use of (es)citalopram, sertraline, or fluoxetine, therefore indicating the utility of PGx testing, particularly in younger people, for PGx-guided antidepressant treatment.