We don't have a lot of insight into he political processes in Russia, and we don't really know how the war is going to plan out...
If the Ukrainians win, that possibly happens in a few weeks... if they can prevent Kyiv being encircled, then it is going to be hard for Russians to take the city.
That would be Plan C failing...
If the Russians take the cities, perhaps that happens in the next few weeks, but after that the insurgency should last for years..
Trying to guess a timeline is very problematic.
If the Russians win and try to change the government in, all likelihood the sanctions last for years, until the West is happy with the elections for a Ukrainian government.
IMO a defeated army returning home almost always changes the government especially in a totalitarian regime,
The other alternative is Putin might die from natural causes, and that might be a circuit-breaker,
For the military campaign itself, there are reasons to be optimistic or pessimistic, experts are expressing various opinions, we might have a better idea in about 1 weeks time... The best case for the Ukrainians is they are able to prevent city sieges, or break city sieges, destroying a lot of Russian hardware in the process.
Once a major city falls and is held for a few days, then the insurgency period probably starts in that area.