The energetic stability of layered covalent organic frameworks (COFs) in slipped structures and the experimental control of interlayer slipping (Q. Fang, Z. Zhuang, S. Gu, R. B. Kaspar, J. Zheng, J. Wang, S. Qiu and Y. Yan, Nat. Commun., 2014, 5, 4503) suggest that the interlayer slipping could be used as a design parameter to enhance the gas adsorption and separation properties of COFs. In this work, we have systematically studied the effect of interlayer slipping on CO2 adsorption and CO2/N2 separation in microporous TpPa1 and mesoporous TpBD and PI-COFs using quantum mechanical and grand canonical Monte Carlo simulations. We found that the slipping affects the number of preferred CO2 adsorption regions and corresponding adsorption energies, resulting in a drastic variation in the adsorption uptake. Our detailed analysis of the heat of adsorption, density distribution and energy landscape reveals that the effect of slipping on CO2 uptake is non-monotonous. We explain this behavior using a simplified model that also provides an optimal range of slipping distances to increase the gas storage performance of COFs. Our results show that the optimized slipped COF structures have approximately three times higher CO2 working capacity and CO2/N2 selectivity as compared to eclipsed structures. The highest CO2 working capacity of 5.8 mol kg-1 and CO2:N2 separation selectivity of 197 (at 1 bar and 298 K) were observed for slipped PI-COF-2 and TpBD COFs, respectively, which are higher than those for any other COFs reported to date. The molecular insight presented here is qualitatively applicable to other similar slipped COFs and is useful for the development of COFs for enhanced gas storage and separation applications.