Adsorption of gases in porous adsorbents such as coal and shale generally exhibits the phenomenon of hysteresis. Most of the previous studies on desorption hysteresis were conducted via experimental tests. However, few theoretical models that represent adsorption–desorption hysteresis of gases in porous sorbents are available. To address this issue, this work develops a new adsorption–desorption model for describing adsorption and desorption isotherms of gases with hysteresis. Particularly, the energetically heterogeneous surfaces of an adsorbent are considered via the patchwise model. Based on the change in site energy distribution, a logarithmically pressure-dependent hysteresis index, which is used to measure the degree of hysteresis, is derived for quantitative assessment of the degree of hysteresis. Besides, the correlation between the desorption isotherm and initialized pressure for desorption is established. The accuracy of the proposed model to adequately describe the adsorption–desorption hysteresis of gas in coal and shale is demonstrated by validating the model against laboratory experiments obtained from the literature. The results indicate that the adsorption isotherm depends significantly on site energy distribution. By comparing the site energy distributions for adsorption and desorption isotherms, it is found that the desorption hysteresis can be attributed to the change in pore size distribution caused by adsorption-induced deformation. The analyses support that the proposed model can be used as an effective tool to quantitatively predict the amount of released gas during desorption, which is significant for designing coalbed methane or shale gas production and assessing long-term CO2 storage behavior.