Results are presented of a search for heavy stable charged particles produced in proton-proton collisions at root s = 13 TeV using a data sample corresponding to an integrated luminosity of 2.5 fb(-1) collected in 2015 with the CMS detector at the CERN LHC. The search is conducted using signatures of anomalously high energy deposits in the silicon tracker and long time-of-flight measurements by the muon system. The data are consistent with the expected background, and upper limits are set on the cross sections for production of long-lived gluinos, top squarks, tau sleptons, and leptonlike long-lived fermions. These upper limits are equivalently expressed as lower limits on the masses of new states; the limits for gluinos, ranging up to 1610 GeV, are the most stringent to date. Limits on the cross sections for direct pair production of long-lived tau sleptons are also determined.