The prediction of remaining useful life (RUL) of lithium-ion batteries is an essential part of the prognostics and health management (PHM) for electric vehicles (EVs). The conventional method to estimate the RUL of batteries based on offline laboratory experiment data may give rise to a considerable amount of error by ignoring the uncertainties occurred in random charge-discharge cycles under operation. To overcome this problem, an online prognostic method based on a gamma process model was presented, and verified by using the experimental data from a set of four batteries test with random discharge recorded by National Aeronautics and Space Administration (NASA). In addition, the probability density function (PDF) and the reliability curve of the batteries were established along with the 0.95 confidence interval to reveal the statistical profile of predicted RULs. Compared to the conventional RUL prediction methods, the proposed method merely requires a small quantity of training data to achieve accurate RUL prediction for randomized usage batteries on EVs.