We have proposed a method to determine the deformation creep and stress relaxation of living cells by using the atomic force microscope (AFM). Based on this method, we have measured the creep and relaxation trajectories of the undifferentiated (HGC-27) and poorly differentiated (AGS) human gastric cancer cells, which were then used to determine their linear viscoelastic properties. We found that the AGS cells are linear viscoelastic materials with the power law creep compliance and relaxation modulus. In contrast, the HGC-27 cells are nonlinear since their measured creep and relaxation behaviours fail to satisfy a verification relation derived based on the linear viscoelastic theory. This fact implies that most traditional methods are not appropriate in determining viscoelastic properties of living cells by simply assuming linear constitutive relation and using classical model of linear springs and dashpots. The combination of suggested power law expression and AFM indentation measurements on the creep compliance and relaxation modulus provides a unique way in determining the viscoelastic properties of living cells.