We study the link between gravitational slopes and the surface morphology on the nucleus of comet 67P/Churyumov-Gerasimenko and provide constraints on the mechanical properties of the cometary material. We computed the gravitational slopes for five regions on the nucleus that are representative of the different morphologies observed on the surface, using two shape models computed from OSIRIS images by the stereo-photoclinometry (SPC) and stereo-photogrammetry (SPG) techniques. We estimated the tensile, shear, and compressive strengths using different surface morphologies and mechanical considerations. The different regions show a similar general pattern in terms of the relation between gravitational slopes and terrain morphology: i) low-slope terrains (0-20 deg) are covered by a fine material and contain a few large ($>$10 m) and isolated boulders, ii) intermediate-slope terrains (20-45 deg) are mainly fallen consolidated materials and debris fields, with numerous intermediate-size boulders from $<$1 m to 10 m for the majority of them, and iii) high-slope terrains (45-90 deg) are cliffs that expose a consolidated material and do not show boulders or fine materials. The best range for the tensile strength of overhangs is 3-15 Pa (upper limit of 150 Pa), 4-30 Pa for the shear strength of fine surface materials and boulders, and 30-150 Pa for the compressive strength of overhangs (upper limit of 1500 Pa). The strength-to-gravity ratio is similar for 67P and weak rocks on Earth. As a result of the low compressive strength, the interior of the nucleus may have been compressed sufficiently to initiate diagenesis, which could have contributed to the formation of layers. Our value for the tensile strength is comparable to that of dust aggregates formed by gravitational instability and tends to favor a formation of comets by the accrection of pebbles at low velocities.