Problems related to gambling and digital gaming have been a topic of concern for years. Less attention has been paid to the probable psychosocial factors behind these problems. While previous studies have established links between stress, loneliness, and addiction, there is a lack of longitudinal research investigating how stress and loneliness affect addictive behaviors, including problem gambling and gaming. This study uses multilevel mixed-effects generalized linear models to analyze the between- and within-person effects of stress and loneliness on gambling and gaming problems. The interaction between stress and loneliness was also investigated. A representative sample of Finns (N = 1,530) answered a survey in 6-month intervals between spring 2021 and autumn 2023; 49.22% of the sample took part at all six time points. The Problem Gambling Severity Index and the Internet Gaming Disorder Test were used to measure gambling and gaming problems. The three-item UCLA Loneliness Scale was used to assess loneliness, and the Perceived Stress Scale was used to evaluate stress. After controlling for gender and age, loneliness was found to increase only gaming problems at both the between- and within-person levels, but not gambling. In contrast, stress enhanced both gambling and gaming problems at the between- and within-person levels. Additionally, loneliness and stress were found to have negative interaction suggesting that their combined effect was lower than their separate effects. The findings provide longitudinal insight into the psychosocial vulnerabilities behind problem gambling and gaming, which can be helpful in designing targeted interventions.