The emergence of an intrinsic quantum anomalous Hall (QAH) insulator with long-range magnetic order triggers unprecedented prosperity for combining topology and magnetism in low dimensions. Here, based on stacked two-dimensional LiFeTe, we confirm that magnetic coupling and topological electronic states can be simultaneously manipulated by just changing the layer numbers. Monolayer LiFeTe shows intralayer ferrimagnetic coupling, behaving as a QAH insulator with Chern number C = 2. Beyond the monolayer, the odd and even layers of LiFeTe correspond to uncompensated and compensated interlayer antiferromagnets, resulting in unexpected QAH and quantum spin Hall (QSH) states, respectively. Moreover, the spin Chern number is proportional to the stacking layer numbers in even-layer LiFeTe, proving that the spin Hall conductivity can be continuously enhanced by increasing layer numbers. Therefore, the odd−even-layer-dependent QAH and QSH effects found in LiFeTe topological insulators offer new insight into regulating quantum states in twodimensional topological materials.