Urinary tract infections (UTIs) are one of the most common long-term complications of diabetes mellitus (DM). Additionally, various factors, such as socio-demographics, type of DM, fasting blood glucose, regular diabetes monitoring, comorbid chronic diseases, HbA1c, body mass index (BMI), and duration of DM, are also thought to predispose individuals to developing UTIs more frequently when they have DM. This research aims to evaluate the risk factors for UTIs and their prevalence among people with DM in Saudi Arabia (KSA). This cross-sectional study was conducted among 440 adults with type 1, type 2, and gestational DM. The participants had to be at least 18 years old, of both genders, and had been suffering from DM for any period of time. A self-administered questionnaire was utilized to collect data on demographic characteristics, such as sex, age, height, weight, material state, education level, income, and clinical profiles of DM and UTI. The crude (COR) and adjusted odds ratios (AOR) were calculated using logistic regression in the IBM SPSS software. The incidence of types 1 and 2 DM and gestational diabetes reached 34.1, 60.9, and 5%, respectively. Most of the participants had first-degree relatives with DM (65.9%). UTI was common in 39.3% of participants. A chi-squared statistical analysis revealed that the frequency of UTI varied depending (χ2 = 5.176, P = 0.023) on the type of DM. Burning urination and abdominal pain were the most common symptoms. The CORs for sex, marital status, hypertension, and BMI were significant (P < 0.05) and had values of 2.68 (95% CI = 1.78–4.02), 0.57 (95% CI = 0.36–0.92), 1.97 (95% CI = 1.14–3.43), and 2.83 (95% CI = 1.19–2.99), respectively. According to the adjusted model, only sex influenced the occurrence of UTIs. The AOR for sex was 3.45 (95% CI = 2.08–5.69). Based on this study, the authorities related to the health of DM patients can use its findings to guide awareness programs and clinical preparedness.