A technique for evaluation of temperature in the Particle-in-Cell method is proposed. A number of computational experiments were conducted in order to reveal how a grid step affects the temperature evaluation according to the proposed technique both in 1D and 3D cases for electrostatic plasma. In order to prove the correctness of the temperature evaluation, the energy of the short-wave temperature harmonics is considered for grids with different steps. The non-physical heating is studied in the self-consistent electrical field as well as the dependence of a temperature decrease on the grid step. It is shown that the temperature values converge with a decrease of the grid step. This allows to conclude that temperature evaluated with the proposed technique is of the physical nature.