We performed a depression GWAS meta-analysis of more than 1.3 million individuals, identifying 251 independent risk variants in 243 genomic loci, of which 64 are novel. We prioritized likely causal genes and revealed novel enrichments of neuro-developmental and functional pathways, prenatal GABAergic neurons, astrocytes and oligodendrocyte lineages. Dissecting the genetic and clinical heterogeneity, we identified distinct polygenic architectures across subgroups of depression and demonstrated increased, sex-dependent, risks for recurrence and psychiatric comorbidity among depression cases with the highest polygenic burden, informing precision psychiatry approaches.