Personality traits, automatic thoughts, and affective states during sexual activity in men have been studied; however, little is known about their interaction. The current study examines the moderation role of personality traits on the relationship between cognitive-affective dimensions and sexual behavior in men. An online sample of 497 men (227 gay men) was recruited, and participants completed a sociodemographic questionnaire, the NEO-Five Factor Inventory (NEO-FFI), the Automatic Thoughts from the Sexual Modes Questionnaire (SMQ) subscale, The Positive Affect-Negative Affect scales (PANAS), and the International Index of Erectile Function (IIEF)/and the IIEF for men who have sex with men (IIEF-MSM). The main findings showed that extraversion, absence of erotic thoughts, positive affect, and negative affect were significant predictors of sexual functioning in gay (β = .266, β = –.345, β = .361; β = –.292, p < .05, respectively) and heterosexual men (β = .208, β = –.382, β = .318; β = –.214, p < .05, respectively); neuroticism significantly predicted sexual functioning only in gay men (β = –.244, p < .05). Extraversion was a moderator between absence of erotic thoughts and sexual functioning in heterosexual men (p = .004), and between positive affect and sexual functioning in gay men (p = .001), and Neuroticism was a moderator between positive affect and sexual functioning in gay men (p < .001). Overall, extraversion buffered the negative impact of absence of erotic thoughts on heterosexual men sexual functioning and the negative impact of lower positive affect on gay men sexual functioning, whereas low neuroticism boost the impact of positive affect on gay men sexual functioning.