Axisymmetric self-consistent dynamics of femtosecond electron bunches in a klystron-type photoelectron gun for a time-resolved electron diffractometer is investigated. The proposed gun consists from a planar gap modulating the bunch and the following units: lens, target-sample (exited by a laser pulse) and screen, placed in series downstream. The gap, restricted by photocathode and anode containing the bunch transit hole or a mesh, accelerates and modulates the photoelectrons of the bunch in longitudinal velocity. The target is placed in the longitudinal focus of the gap, the focus of which is after and in a rather far distance from the lens focusing the photoelectrons on the screen. The optimized magnitudes of the bunch population and the other parameters of the gun are determined from the terms of getting the longitudinal focus length of about 100 mm and the bunch duration, its energy spread of the order of 100 fs and 1 eV, respectively, at the point of this focus. The results of the bunch dynamics simulation for the bunch population of 105-104 photoelectrons, the initial bunch duration of 500 fs and at consideration of the initial bunch radius not more 0.5 mm and the initial energy spread from 0 to 0.5 eV are presented and discussed.