We determine the critical layer thickness for the appearance of misfit dislocations as a function of the misfit ε between the lattice constants of the substrate and the adsorbate from Kinetic Monte Carlo (KMC) simulations of heteroepitaxial growth. To this end, an algorithm is introduced which allows the off-lattice simulation of various phenomena observed in heteroepitaxial growth including critical layer thickness for the appearance of misfit dislocations, or self-assembled island formation. The only parameters of the model are deposition flux, temperature and a pairwise interaction potential between the particles of the system. Our results are compared with a theoretical treatment of the problem and show good agreement with a simple powe...