The causes of disordered sleep, frequently reported by patients with inflammatory bowel diseases (IBD), are poorly understood. The study aimed to evaluate sleep quality in IBD patients and to identify factors affecting their sleep. IBD patients (n = 133) and healthy controls (HC; n = 57) were included in the study and completed sleep questionnaires (Pittsburgh Sleep Quality Index (PSQI), Athens insomnia scale (AIS), and Epworth sleepiness scale (ESS)), Beck Depression Inventory (BDI), and pain scales (Visual Analogue Scale and Laitinen Pain Scale). IBD patients attained higher scores in all sleep questionnaires compared to HC: PSQI, AIS, and ESS (all p < 0.001). They also had prolonged sleep latency (p < 0.001) with reduced sleep efficiency (p < 0.001). Patients in exacerbation of IBD had higher scores in PSQI (p = 0.008), ESS (p = 0.009), but not in AIS, compared to those in remission. Participants with comorbid chronic diseases had higher scores in PSQI and AIS, but not in ESS, compared to others. Multiple regression revealed that the sleep questionnaire results were significantly affected by mood level (BDI), but not by the aforementioned pain scales. Sleep impairment in IBD patients is a common problem that deserves attention in everyday clinical practice and mood level seems to be the main factor affecting the quality of sleep in IBD patients.