Gas diffusion is a pivotal process during shale gas recovery, which is determined by diffusion coefficient to a large extent. In previous studies, the gas diffusion coefficient is generally assumed as a constant. However, increasing experiments prove that the diffusion coefficient of shale gas is strongly time-dependent. Therefore, to perfect the theory of shale gas diffusion, this paper proposes a time-dependent diffusion model for shale gas, which incorporates time-dependent gas diffusion coefficient, composing of the bulk diffusion coefficient for free gas in organic and inorganic pores, as well as the surface diffusion coefficient for adsorbed gas in organic pores. To validate the accuracy of the new theory, we calibrate the theoretical results against experimental data, and the results show that they have strong correlation, and the time-dependent diffusion model is superior to classical model. Finally, the numerical analysis of gas dynamic diffusion process in shale matrix is conducted. The results show that at the end of diffusion, a large amounts of shale gas remain trapped in the matrix core due to the attenuation of gas diffusion coefficient. In addition, neglecting the time-dependent nature of gas diffusion in shale matrix leads to a significant overestimation of gas production.