Water and material cycles in rivers are controlled by diverse sources of recharge and flow paths, which exhibit spatial and temporal variations in the contributions of water sources and hydrologic processes. To assess the variation of water recharging, the stable isotope abundances of hydrogen and oxygen (δ2H and δ18O) of 152 water samples collected from the Yangtze River mainstream during May (the flat season) and September (the wet season) in 2021 were analyzed. Bayesian modelling was used to calculate the contribution rates of precipitation, glacier snow meltwater, and groundwater. The isotopic compositions of precipitation and the river exhibited comparable seasonal and spatial characteristics. The Bayesian model results showed that the mainstream was governed by precipitation, with a greater contribution of precipitation in the lower reaches during the wet season. Lakes had a larger contribution during the flat season, as evidenced by the greater increase in the magnitude of δ18O values in the mid-lower reaches during this period. The mid-lower reaches of the river had a decreased river evaporation line (REL) slope, which could be owe to lake replenishment. In addition to intensifying the seasonal variations in the contribution ratios of the lakes, the emplacement of the Three Gorges Dam (TGD) reduced the groundwater contribution of the reservoir. This study enhances our understanding of the hydrological and material cycles in the Yangtze River Basin and provides vital baseline knowledge on the contribution of different recharge sources in the mainstream.