T. Rowe Price Associates Inc. sold roughly 81% of its shares of Tesla Inc. over the first three months of the year, marking a sharp retreat for a firm that for years had been one of the electric-car maker’s biggest investors.

The fund manager held 1.7 million Tesla shares as of March 31, down from 8.9 million shares at the end of 2018, according to a Wednesday filing with the Securities and Exchange Commission.

T....