Critical dynamics in film geometry is analyzed within the field-theoretical approach. In particular we consider the case of purely relaxational dynamics (Model A) and Dirichlet boundary conditions, corresponding to the so-called ordinary surface universality class on both confining boundaries. The general scaling properties for the linear response and correlation functions and for dynamic Casimir forces are discussed. Within the Gaussian approximation we determine the analytic expressions for the associated universal scaling functions and study quantitatively in detail their qualitative features as well as their various limiting behaviors close to the bulk critical point. In addition we consider the effects of time-dependent fields on the fluctuation-induced dynamic Casimir force and determine analytically the corresponding universal scaling functions and their asymptotic behaviors for two specific instances of instantaneous perturbations. The universal aspects of nonlinear relaxation from an initially ordered state are also discussed emphasizing the different crossovers occurring during this evolution. The model considered is relevant to the critical dynamics of actual uniaxial ferromagnetic films with symmetry-preserving conditions at the confining surfaces and for Monte Carlo simulations of spin system with Glauber dynamics and free boundary conditions.