Bladder cancer is a complex disease with high morbidity and mortality rates. At least 430,000 cases are diagnosed annually worldwide. Cancer pain is the most common and distressing symptom in cancer patients. Studies have reported depression, anxiety, and decreased quality of life in survivors of various cancers. The study of pain-related genes in cancer patients may provide a basis for developing targeted drugs for cancer therapy, which could reduce pain and improve quality of life of cancer patients. In this study, the mRNA expression and clinical data of bladder cancer patients were downloaded from public databases. A total of 103 pain-related genes were also downloaded from the public databases. Univariate Cox regression analysis identified 17 pain-related genes that were significantly associated with overall survival. We calculated a pain-related risk score for each patient, constructed a bladder cancer pain risk model, and categorized bladder cancer patients into two risk subtypes. Differences in prognosis, differential gene expression, immune cell signatures, hallmarks, metabolic pathways, and somatic mutations between the different risk subtypes were systematically investigated. Eight drugs associated with bladder cancer risk subtypes were identified. Their differences in the high- and low-risk subtypes of bladder cancer were examined. In addition, the response to immunotherapy was analyzed in patients with different pain-related subtypes. Results revealed significant differences in these characteristics. Finally, a predictive model for pain-related risk subtypes in patients with bladder cancer was established. The study findings provide a reference for prognostication and personalized medical treatment of bladder cancer patients.