We demonstrate that stability criteria can be used to calculate the maximum angle of stability theta(m) of a granular medium composed of spherical particles in three dimensions and circular disks in two dimensions. The predicted angles are in good agreement with the experimental results. Furthermore, we determine the dependence of theta(m) on cohesive forces, applying the results to wet granular material by calculating the dependence of theta(m) on the liquid content of the material. We have also studied wet granular media experimentally and find good agreement between the theory and our experimental results.