It's going to take 100,000+ dead Russians. At some point the military and civilian leadership in Russia will realize that Putin has to go, and that is when all this will end.
There is a lot of death and destruction yet to go. Ukraine will struggle with hundreds of thousands of new bodies arming Russia's antique military machine. Iran is flying in large quantities of drones that will expose Ukraine's forces to effective Russian artillery. But the outcome won't change; Ukraine will ultimately win because it's not a war of choice for Ukraine and Ukraine has the allies it needs to keep fighting.