We investigate the energy-loss characteristics of an ion in warm dense matter (WDM) and dense plasmas concentrating on the influence of electronic correlations. The basis for our analysis is a recently developed ab initio quantum Monte Carlo- (QMC) based machine learning representation of the static local field correction (LFC) [Dornheim et al., J. Chem. Phys. 151, 194104 (2019)JCPSA60021-960610.1063/1.5123013], which provides an accurate description of the dynamical density response function of the electron gas at the considered parameters. We focus on the polarization-induced stopping power due to free electrons, the friction function, and the straggling rate. In addition, we compute the friction coefficient which constitutes a key quantity for the adequate Langevin dynamics simulation of ions. Considering typical experimental WDM parameters with partially degenerate electrons, we find that the friction coefficient is of the order of γ/ω_{pi}=0.01, where ω_{pi} is the ionic plasma frequency. This analysis is performed by comparing QMC-based data to results from the random-phase approximation (RPA), the Mermin dielectric function, and the Singwi-Tosi-Land-Sjölander (STLS) approximation. It is revealed that the widely used relaxation time approximation (Mermin dielectric function) has severe limitations regarding the description of the energy loss of ions in a correlated partially degenerate electrons gas. Moreover, by comparing QMC-based data with the results obtained using STLS, we find that the ion energy-loss properties are not sensitive to the inaccuracy of the static local field correction (LFC) at large wave numbers, k/k_{F}>2 (with k_{F} being the Fermi wave number), but that a correct description of the static LFC at k/k_{F}≲1.5 is important.