The B7-CD28 gene family plays a key role in regulating cellular immunity and is closely related to tumorigenesis and immune evasion. Here, we explored associations between clinical and immune features and B7-CD28 gene family expression in Gene Expression Omnibus (GEO) datasets representing 1812 diffuse large B-cell lymphoma (DLBCL) patients. This included 414 in the GSE10846 training cohort and 470 and 928 patients in the GSE31312 and GSE117556 validation cohorts, respectively. Four survival-associated genes identified in the GSE10846 cohort by univariate Cox analysis were incorporated into a multivariate analysis, ultimately establishing a three-gene risk signature. Risk scores assigned based on expression of these genes were validated by Kaplan–Meier and multivariable Cox analyses in the remaining datasets and in important clinical subsets. High-risk patients had shorter overall survival and, in some cases, progression-free survival than low-risk patients. Additionally, expression of programmed cell death 1 (PD-1) and programmed death ligand 1 (PD-L1), as well as several other important immune checkpoint genes, differed between high-risk and low-risk patients, as did the proportions of various immune-infiltrating cells. Finally, further analysis confirmed that these B7-CD28 genes play important roles in immune responses altered in DLBCL.