One of the key science drivers for the development of the SKA is to observe the neutral hydrogen, HI, in galaxies as a means to probe galaxy evolution across a range of environments over cosmic time. Over the past decade, much progress has been made in theoretical simulations and observations of HI in galaxies. However, recent HI surveys on both single dish radio telescopes and interferometers, while providing detailed information on global HI properties, the dark matter distribution in galaxies, as well as insight into the relationship between star formation and the interstellar medium, have been limited to the local universe. Ongoing and upcoming HI surveys on SKA pathfinder instruments will extend these measurements beyond the local universe to intermediate redshifts with long observing programmes. We present here an overview of the HI science which will be possible with the increased capabilities of the SKA and which will build upon the expected increase in knowledge of HI in and around galaxies obtained with the SKA pathfinder surveys. With the SKA1 the greatest improvement over our current measurements is the capability to image galaxies at reasonable linear resolution and good column density sensitivity to much higher redshifts (0.2 < z < 1.7). So one will not only be able to increase the number of detections to study the evolution of the HI mass function, but also have the sensitivity and resolution to study inflows and outflows to and from galaxies and the kinematics of the gas within and around galaxies as a function of environment and cosmic time out to previously unexplored depths. The increased sensitivity of SKA2 will allow us to image Milky Way-size galaxies out to redshifts of z=1 and will provide the data required for a comprehensive picture of the HI content of galaxies back to z~2 when the cosmic star formation rate density was at its peak.