Ulnar nerve entrapment (UNE) is the second most common entrapment neuropathy in the upper extremity. The aetiology of UNE is multifactorial and is still not fully understood. The aim of the study was to identify occupational risk factors for UNE and to determine whether smoking modifies the effects of work-related factors on UNE. The study population consisted of the Northern Finland Birth Cohort of 1966 (NFBC1966). In total, 6325 individuals active in working life participated at baseline in 1997. Occupational risk factors were evaluated by a questionnaire at baseline. The data on hospitalizations due to UNE were obtained from the Care Register for Health Care between 1997 and 2018. The incidence rate of hospitalization due to UNE was 47.6 cases per 100,000 person-years. After adjusting for confounders, entrepreneurs (Hazard ratio (HR) = 3.68, 95% CI 1.20–11.27), smokers (HR = 2.51, 95% CI 1.43–4.41), workers exposed to temperature changes (HR = 1.72, 95% CI 1.00–2.93), workers with physically demanding jobs (HR = 3.02, 95% CI 1.39–6.58), and workers exposed to hand vibration (HR = 1.94, 95% CI 1.00–3.77) were at an increased risk of hospitalization for UNE. Exposure to work requiring arm elevation increased the risk of hospitalization due to UNE among smokers (HR = 2.62, 95% CI 1.13–6.07), but not among non-smokers. Work-related exposure to vibration and temperature changes, and physically demanding work increase the risk of hospitalization for UNE. Smoking may potentiate the adverse effects of work-related factors on UNE.