This question is the source of some controversy, at least in the United States. This is a fair amount of disagreement among historians as to the relative importance of Gorbachev and Ronald Reagan in causing the fall of the Soviet Union.
In a way, one could argue that neither man was the key. It is possible to argue that the USSR was always doomed to fail because of its system. By the time that Gorbachev took power, the Soviet Union was in very bad shape. It was economically unable to give its people the consumer goods and standard of living that they wanted. It was also unable or unwilling to give them the personal and political freedoms they desired. These problems made the USSR fundamentally unstable by the 1980s.
It was in this context that Gorbachev and Reagan come on the scene. Reagan’s supporters claim that he was more important than Gorbachev. They say that he took hard line actions towards the USSR that increased the stresses on that country and caused it to fall apart. Others argue that Gorbachev was more important. It was he who instituted the perestroika and glasnost reforms. His attempts to fix the problems that beset the Soviet Union ended up giving people more freedom. They used that freedom to overthrow the Soviet Union.
Thus, the answer to this question is not clear. However, it is clear that Gorbachev played at least some role in ending the USSR. He set about trying to reform the system, thus helping to cause its demise.