The superconductivities of samples prepared by several procedures were found to degrade under ambient environment. The degradation mechanism was studied by measuring the change of surface chemical composition of dense MgB2 pellets (prepared by hot isostatic pressure, HIPed) under atmospheric exposure using X-ray Photoelectron Spectroscopy (XPS). Results showed that samples with poor connectivity between grains and with smaller grain sizes degrade with time when exposed to ambient conditions. In these samples, the Tc did not change with time, but the superconducting transition became broader and the Meissner fraction decreased. In contrast, our well-sintered and the HIPed samples remained stable for several months under ambient condition. The degradation was found to be related to surface decomposition as observed by XPS. We observed the formation of oxidized Mg, primarily in the form of a Mg hydroxide, the increase of C and O contents, and the reduction of B concentration in the surface layer of MgB2 samples.