Putin is simply gambling that he can wear down the Ukrainians faster than he can wear down his own forces. He wishes to seize the remaining parts of Luhansk and Donetsk oblasts (possible), and Kharkov and the rest of Kherson extending into Odessa (very unlikely) before trying to reach some negotiated peace that will give a respite until he can attack again, unless Ukraine gets into NATO.
My guess is it will drag on until the next President takes office. If, by the grace of God, that President is Trump, he will offer Putin a deal he will find difficult to swallow: either Donbas or Crimea, but not both, or withdrawal to the February 2022 lines. Then we'll see.
Wrong…Trump will not offer Donbas or Crimea…he will offer that Russia keeps all the land they have currently conquered and stop the war, or he dramatically increases Ukrainian support.