The redshift of very distant galaxies is mainly due to the expansion of space whilst the light has been travelling towards us. The basic relationship (at non-relativistic speeds) is that
$v = H_0 d$ where $v$ is the velocity implied by the redshift and $d$ is the distance. The constant of proportionality $H_{0} \sim 70$ km/s per Mpc. That is, a Galaxy increases its apparent velocity with respect to us by 70 km/s for every Mpc (about 3.1 million light years) it is away.
Galaxies also have a "peculiar" velocity with respect to the co-moving cosmological rest frame. This produces a regular doppler shift, but this is indistinguishable in a spectrum from the cosmological redshift due to the expansion of the universe. Typical peculiar velocities, which are caused by relatively local galaxy-galaxy gravitational interactions or motion within a galaxy cluster, are a few hundred km/s.
An example helps. There are galaxies gravitationally bound in a cluster of galaxies that is a billion pc away. The average redshift will look like the galaxies are receding at around 70,000 km/s. If the peculiar velocities are only a few hundred km/s then the redshift is completely dominated by this cosmological redshift.
However, if the galaxies are taken individually, some have redshifts a little bigger and some a little smaller (by a fraction of a percent). This is because the galaxies have their own peculiar motion with respect to the cluster (and this can be measured)
If peculiar motions tend to produce redshifts equivalent to a few hundred km/s, then this is ten times smaller than the cosmological redshift once we get to distances $>40$ Mpc (around 130 million light years). So beyond this, individual galaxy redshifts yield distances to accuracies better than 10% and obviously this improves as we go to greater distance. If you look at a cluster of galaxies then you can also improve matters by $\sqrt{n}$ by averaging over the individual galaxy peculiar motions.