The rock wettabilities and water contact angles describing interactions between CO2, CH4, brine and shale formations are of great significance to CO2 sequestration and enhanced gas recovery processes. However, water contact angles on the surfaces of shale organic matter in the atmospheres of CO2 and CH4 under reservoir conditions are not well-understood. In this study, we present an investigation of water/brine contact angles as functions of temperature, pressure, salinity, ion types, and gas contents by molecular dynamics simulations, and compare results with data from literature. It is found that temperature has profound effects on water contact angles below the critical temperature at an intermediate pressure. Meanwhile, water contact angles increase with pressure before reaching 180° at high pressure and the CO2-water-shale organic matter system turns from a neutrally-wet state to a CO2-wet state at the critical pressure of CO2. We also demonstrate that salinity and ion types have minor impacts on the brine contact angles in the CO2-brine-shale system. Only a slight increase in water contact angles is observed with increasing salinity, and an increase in brine contact angles caused by the divalent cations Mg2+ and Ca2+ is larger than that by the monovalent cations Na+ at the same salinity. Additionally, an increase in the CO2 fraction of gas mixtures can increase water contact angles at the same pressure and temperature. The surfaces of shale organic matter have a stronger affinity for CO2 than CH4, which contributes to a higher CO2 adsorption capacity and improves the displacement efficiency of CH4.