Purpose: The aim was to analyse the relationships between work environment characteristics and periods of sick leave (> 14 days) in individuals diagnosed with common mental disorders (CMDs) across 1993–2014. Additionally, the study describes changes in the work environment and sick leave trends over these two periods. Methods: From the Swedish Work Environment Surveys (SWES) 1993–2013, participants with a diagnosis of a CMD up to five years before the interview were drawn (n = 3795). Risk ratios (RRs) of the annual average number of sick leave days one year after the interview in SWES (1993–2014) were calculated for various work environment characteristics, along with 95% confidence intervals (CIs). Results: Having flexible working hours (RR 0.65: 0.46–0.91) and having an active job (RR 0.60: 0.41–0.88), that is, high job demands and high job control, were associated with a significantly decreased risk for a spell of sick leave > 14 days after adjusting for interview year, age, sex, and educational level. There was a tendency that also some aspects of job control, i.e. influence over working hours (RR 0.79: 0.62–1.01) and influence over work pace (0.80: 0.62–1.03), were associated with a lower risk of having > 14 days of sick leave. There was a more substantial effect on these work environment factors in 2009–2013 than 1993–2007. Conclusion: Enabling flexible working hours and influencing work pace and working hours can decrease the risk of sick leave among employees diagnosed with a CMD.