A radio-frequency photogun for the generation of ultrashort electron beams to be used in fast electron diffractoscopy, wakefield acceleration experiments, and the design of accelerating structures of the millimeter range is modeled. The beam parameters at the photogun output needed for each type of experiment are determined. The general outline of the photogun is given, its electrodynamic parameters are calculated, and the accelerating field distribution is obtained. The particle dynamics is analyzed in the context of the required output beam parameters. The optimal initial beam characteristics and field amplitudes are chosen. A conclusion is made regarding the obtained beam parameters.