Mikhail Gorbachev signed peace accords that led to a withdrawal of Afghanistan in 1989. The Soviet Union collapsed two years later, toward the end of 1991.
Russia very quickly reverted to a similar system to what it once had and under Putin's leadership, it recreated many of the institutions of the Soviet Union, such as the KGB. However, it has an economy the size of Italy and its capabilities of coercing former Soviet republics are limited to what we saw with attacks on Crimea, Ukraine, or Georgia. It can't recreate the Soviet Union as a union of 15 republics.