Most TRIM family members characterized by the E3-ubiquitin ligases, participate in ubiquitination and tumorigenesis. While there is a dearth of a comprehensive investigation for the entire family in gastric cancer (GC). By combining the TCGA and GEO databases, common TRIM family members (TRIMs) were obtained to investigate gene expression, gene mutations, and clinical prognosis. On the basis of TRIMs, a consensus clustering analysis was conducted, and a risk assessment system and prognostic model were developed. Particularly, TRIM31 with clinical prognostic and diagnostic value was chosen for single-gene bioinformatics analysis, in vitro experimental validation, and immunohistochemical analysis of clinical tissue microarrays. The combined dataset consisted of 66 TRIMs, of which 52 were differentially expressed and 43 were differentially prognostic. Significant survival differences existed between the gene clusters obtained by consensus clustering analysis. Using 4 differentially expressed genes identified by multivariate Cox regression and LASSO regression, a risk scoring system was developed. Higher risk scores were associated with a poorer prognosis, suppressive immune cell infiltration, and drug resistance. Transcriptomic data and clinical sample tissue microarrays confirmed that TRIM31 was highly expressed in GC and associated with a poor prognosis. Pathway enrichment analysis, cell migration and colony formation assay, EdU assay, reactive oxygen species (ROS) assay, and mitochondrial membrane potential assay revealed that TRIM31 may be implicated in cell cycle regulation and oxidative stress-related pathways, contribute to gastric carcinogenesis. This study investigated the whole functional and expression profile and a risk score system based on the TRIM family in GC. Further investigation centered around TRIM31 offers insight into the underlying mechanisms of action exhibited by other members of its family in the context of GC.