All depends on how much support the West gives and how much political will the citizens of other countries like the US care. Right now, everybody is really supportive of giving aid.
If the West really ramps up the military weapons, Ukraine could completely expel Russia in the East and I can see this happening by the end of the year.
If the West keeps giving piecemeal aid little by little (like how they've been doing) then this can last years. At the beginning of the conflict, the West had very little faith Ukraine could resist and only gave them some anti-tank weapons and artillery. They thought it would only last days and saw no point in giving any significant aid.
But Ukraine really stepped up and over performed. That gave the West some faith that Ukraine could provide resistance, so they started slowly ramping up the aid. They're still not doing all they can to support them.
The US are sending GLSDB missiles to Ukraine soon. These will significantly change the battlefield as it allows precision missile strikes into Crimea and deep in Russian positions. These are coming soon so it will be interesting how it changes the course of the war. Every new technological advantage we have given the Ukrainians so far, they've used super effectively to kick the shit out of the Russians.