The hydrological regime of rivers significantly changes after dam impoundment, which in turn affects the particle composition and heavy metal fractions of the river sediments. From June to July 2019, the sediments from 26 sampling sections were collected along the main stream of the Yangtze River from Panzhihua City in the upper reaches of the Yangtze River to Hukou City in the middle reaches of the Yangtze River. The concentrations and fractions of As, Cd, Co, Cr, Cu, Ni, Pb, and Zn were measured using the BCR three-step extraction procedure. The pollution status and potential ecological risk of heavy metals in sediments were evaluated using the geo-accumulation index, the sediment quality guideline, and the risk assessment coding method (RAC). The results showed that the average particle size of sediments in the upper reaches of the Yangtze River (Jinsha River cascade reservoir section and the Three Gorges reservoir section) decreased from upstream to downstream, the total concentrations of As and Zn increased, and the variation trend in the middle reaches was not obvious. The content of clay particles was significantly positively correlated with the acid-soluble fraction concentrations of Cd and Ni. Cd was mainly in the residual fraction (59.26%) and acid-soluble fraction (24.67%). Large parts of Cr and Ni were residual fractions accounting for 92.41% and 83.41%, respectively. As, Co, Cu, Pb, and Zn were mainly in the residual fraction and the reducible fraction. The order of decrease for the pollution degree (Igeo) of As, Cd, Co, Cr, Ni, and Zn was the Jinsha River, the middle reaches of the Yangtze River, and the Three Gorges Reservoir. The decrease order of bioavailability (RAC) of Cd, Co, Cr, Cu, Ni, and Zn was the Three Gorges Reservoir, the Jinsha River, and the middle reaches of the Yangtze River. The bioavailability of As and Pb decreased in the order of the middle reaches of the Yangtze River, the Three Gorges, and the Jinsha River. According to the classification of the RAC, Cd in the Three Gorges Reservoir area exhibited a high risk with the RAC accounting for 48.44%. Cu, Ni, and Zn showed a low or medium risk.