Gain-of-function (GOF) mutations in PIK3CD, encoding the p110δ subunit of phosphatidylinositide 3-kinase (PI3K), cause a primary immunodeficiency. Affected individuals display impaired humoral immune responses following infection or immunization. To establish mechanisms underlying these immune defects, we studied a large cohort of patients with PIK3CD GOF mutations and established a novel mouse model using CRISPR/Cas9-mediated gene editing to introduce a common pathogenic mutation in Pik3cd. In both species, hyperactive PI3K severely affected B cell development and differentiation in the bone marrow and the periphery. Furthermore, PI3K GOF B cells exhibited intrinsic defects in class-switch recombination (CSR) due to impaired induction of activation-induced cytidine deaminase (AID) and failure to acquire a plasmablast gene signature and phenotype. Importantly, defects in CSR, AID expression, and Ig secretion were restored by leniolisib, a specific p110δ inhibitor. Our findings reveal key roles for balanced PI3K signaling in B cell development and long-lived humoral immunity and memory and establish the validity of treating affected individuals with p110δ inhibitors.