As the CMB photons travel across the universe the will "fall into" and then "climb out" of various potential wells.
A potential difference of $\Delta \Phi$ is associated with a redshift $\Delta \Phi/c^2$.
However, if a photon falls into and then comes out of the same potential then there is no net effect.
Of course when a photon reaches us, it has finally fallen into the gravitational potential of our Galaxy and into the potential of the Sun (which is much smaller). This produces a very small blueshift in all photons received from outside the Milky Way of about 1 part in a million.
The Milky Way is quite a massive galaxy, so generally speaking the light emitted by other galaxies is redshifted by a similar amount as light leaves them, but then blueshifted as it enters our Milky Way potential. These shifts of order $10^{-6}$ for a big galaxy, or maybe $10^{-5}$ for a big galaxy cluster, are tiny compared with cosmological redshifts.
An interesting phenomenon though is that if a gravitational potential feature is large enough, then it is possible that the potential changes whilst the photon transits across it. This happens in a universe in which the expansion is accelerating (e.g. because of dark energy). In which case, the redshift it accumulates coming out of the potential is less than the blueshift it accumulated going into the potential. This leads to small fluctuations in the cosmic microwave background, associated with things like galaxy superclusters, and is known as the Integrated Sachs-Wolfe effect.
The integrated Sachs-Wolfe effect has been detected (e.g. Granett et al. 2008). The fluctuations are of order $10^{-5}$ K in the CMB temperature and the fluctuations are associated with supervoids and superclusters.