  Strongly gravitational lensed quasars can be used to measure the so-called
time-delay distance $D_{\Delta t}$, and thus the Hubble constant $H_0$ and
other cosmological parameters. Stellar kinematics of the deflector galaxy play
an essential role in this measurement by: (i) helping break the mass-sheet
degeneracy; (ii) determining in principle the angular diameter distance $D_{\rm
d}$ to the deflector and thus further improving the cosmological constraints.
In this paper we simulate observations of lensed quasars with integral field
spectrographs and show that spatially resolved kinematics of the deflector
enable further progress by helping break the mass-anisotropy degeneracy.
Furthermore, we use our simulations to obtain realistic error estimates with
current/upcoming instruments like OSIRIS on Keck and NIRSPEC on the James Webb
Space Telescope for both distances (typically $\sim6$ per cent on $D_{\Delta
t}$ and $\sim10$ per cent on $D_{\rm d}$). We use the error estimates to
compute cosmological forecasts for the sample of nine lenses that currently
have well measured time delays and deep Hubble Space Telescope images and for a
sample of 40 lenses that is projected to be available in a few years through
follow-up of candidates found in ongoing wide field surveys. We find that $H_0$
can be measured with 2 per cent (1 per cent) precision from nine (40) lenses in
a flat $\Lambda$cold dark matter cosmology. We study several other cosmological
models beyond the flat $\Lambda$cold dark matter model and find that time-delay
lenses with spatially resolved kinematics can greatly improve the precision of
the cosmological parameters measured by cosmic microwave background data.
