Background: Computer and mobile games are widely used among undergraduate students worldwide, especially in China. Our objective was to predict the time spent playing computer and mobile games based on interpersonal relations and social cognitive theory constructs (i.e., expectation, self-efficacy, and self-control). Methods: The cross-sectional survey was conducted in two medical universities using a sample of 1557 undergraduate students recruited by cluster sampling. The five-point Likert questionnaire was jointly developed by researchers from Chongqing Medical University and Jackson State University. Results: Approximately 30% and 70% of the students played computer and mobile games, respectively. The daily times spent by participants on computer games were 25.61 ± 73.60 min (weekdays) and 49.96 ± 128.60 min (weekends), and 66.07 ± 154.65 min (weekdays) and 91.82 ± 172.94 min (weekends) on mobile games. Students with high scores of interpersonal relations but low scores of self-efficacy spent prolonged time playing computer games on weekdays and weekends ( p < 0.05 for all). Students with low scores of expectation spent prolonged time playing computer games on weekdays ( p < 0.05). Students with high scores of interpersonal relations but low scores of self-efficacy and self-control spent prolonged time playing mobile games on weekdays and weekends ( p < 0.05 for all). Conclusions: The prevalence and duration of playing mobile games were higher than those of playing computer games among medical undergraduate students in Chongqing, China. This study determined the interpersonal relations, self-efficacy, self-control, and expectation of the students at the time of playing computer and mobile games. Future studies may consider studying the interaction among game-related behaviours, environments, and personality characteristics.