As documented in Lester Grau’s paper, Breaking Contact Without Leaving Chaos: The Soviet Withdrawal from Afghanistan, the Soviet Union exodus from Afghanistan was orderly, on their own terms, and left institutions that were expected to endure (which they did for several years with Soviet financial support).
A recent Pravda op-ed goes so far as to state that the USSR may have even won their war in the article Did the USSR win the war in Afghanistan?
When the funding dried-up with the fall of the Soviet Union in 1992, it didn’t take long for the stability to leave and the Afghanistan was soon engulfed in a civil war. So much for the lasting institutions created by the USSR.
But the Pravda article uses the U.S. war in Vietnam as it’s benchmark. But even that comparison may be premature–judging by the tourist trade in Vietnam, we clearly must have won that war.
The Soviet war in Afghanistan by the same measure? Not so much.