In this paper, we develop a technique of adaptive time stepping and combine it with dynamic mesh adaptation to simulate unsteady Navier-Stokes flows over stationary or moving bodies. The second order Backward Differentiation Formula (BDF2) is employed for time discretization and the adaptation of time step is based on the estimation of temporal error. Via a PID (Proportional Integral Derivative) controller or a classical heuristic controller, the size of time step is determined adaptively by the estimate of temporal error and the specified tolerance. In order to eliminate the lag of the adapted mesh behind the unsteady solution, which is associated with the size of time step, a predictor-corrector scheme is adopted in the dynamic mesh adaptation. The efficiency and reliability of the present adaptive time and space discretization approach are validated by the numerical experiments for two- and three-dimensional flows. In the numerical experiments, the behaviors of different error estimators and step-size controllers have also been compared and discussed.