The Chang 7 shale oil reservoir has low natural energy and is both tight and highly heterogeneous, resulting in significant remaining oil after depletion development. CO2 huff and puff (huff-n-puff) is an effective way to take over from depletion development. Numerous scholars have studied and analyzed the CO2 huff-n-puff mechanism and parameters based on laboratory core sample huff-n-puff experiments. However, experimental procedures are not comprehensive, leading to more general studies of some mechanisms, and existing CO2 huff-n-puff experiments struggle to reflect the effect of actual reservoir heterogeneity due to the limited length of the experimental core samples. In this paper, CO2 huff-n-puff laboratory experiments were performed on short (about 5 cm) and long (about 100 cm) core samples from the Chang 7 shale oil reservoir, and the microscopic pore fluid utilization in the short samples was investigated using a nuclear magnetic resonance (NMR) technique. We then analyzed and discussed the seven controlling factors of CO2 huff-n-puff and their recovery-enhancing mechanisms. The experimental results show that the cumulative recovery increased with the number of huff-n-puff cycles, but the degree of cycle recovery decreased due to the limitation of the differential pressure of the production. The significant increase in recovery after the CO2 mixed-phase drive was achieved by increasing the minimum depletion pressure as well as the gas injection amount. The soaking time was adjusted appropriately to ensure that the injected energy was thoroughly utilized; too short or too long a soaking time was detrimental. The pressure depletion rate was the main factor in the CO2 huff-n-puff effect in shale. If the pressure depletion rate was very high, the effective permeability loss was larger. In the CO2 huff-n-puff process of the Chang 7 shale oil reservoir, the improvement in oil recovery was mainly contributed to by mesopores and small pores. The huff-n-puff experiments using long cores could better characterize the effect of heterogeneity on the huff-n-puff effect than short cores.