We use a suite of cosmological hydrodynamic simulations to systematically quantify the accretion rates of baryons into dark matter haloes and the resulting baryon mass fractions, as a function of halo mass, redshift and baryon type (including cold and hot gas). We find that the net baryonic accretion rates through the virial radius are sensitive to galactic outflows and explore a range of outflow parameters to illustrate the effects. We show that the cold gas accretion rate is in general not a simple universal factor of the dark matter accretion rate, and that galactic winds can cause star formation rates to deviate significantly from the external gas accretion rates, both via gas ejection and re-accretion. Furthermore, galactic winds can inject enough energy and momentum in the surrounding medium to slow down accretion altogether, especially in low-mass haloes and at low redshift, but the impact of outflows is suppressed with increasing halo mass. By resolving the accretion rates versus radius from the halo centres, we show how cold streams penetrate the hot atmospheres of massive haloes at z≥ 2, but gradually disappear at lower redshift. The total baryon mass fraction is also strongly suppressed by outflows in low-mass haloes, but is nearly universal in the absence of feedback in haloes above the UV background suppression scale, corresponding to circular velocities vc∼ 50 km s−1. The transition halo mass, at which the gas mass in haloes is equal for the cold and hot components, is roughly constant at ∼1011.5 M⊙ and does not depend sensitively on the wind prescription. We provide simple fitting formulae for the cold gas accretion rate and the corresponding efficiency with which dark matter channels cold gas into haloes in the no-wind case. Finally, we show that cold accretion is broadly consistent with driving the bulk of the highly star-forming galaxies observed at z∼ 2, but that the more intense star formers likely sample the high end of the accretion rate distribution, and may be additionally fuelled by a combination of gas recycling, gas re-accretion, hot mode cooling and mergers.