The real-time dynamics of the Fermi-Hubbard model, driven out of equilibrium by quenching or ramping the interaction parameter, is studied within the framework of the nonequilibrium self-energy functional theory. A dynamical impurity approximation with a single auxiliary bath site is considered as a reference system and the time-dependent hybridization is optimized as prescribed by the variational principle. The dynamical two-site approximation turns out to be useful to study the real-time dynamics on short and intermediate time scales. Depending on the strength of the interaction in the final state, two qualitatively different response regimes are observed. For both weak and strong couplings, qualitative agreement with previous results of nonequilibrium dynamical mean-field theory is found. The two regimes are sharply separated by a critical point at which the low-energy bath degree of freedom decouples in the course of time. We trace the dependence of the critical interaction of the dynamical Mott transition on the duration of the interaction ramp from sudden quenches to adiabatic dynamics, and therewith link the dynamical to the equilibrium Mott transition.