The Cold war officially ended with the dissolution of the Warsaw Pact in July 1, 1991. The Cold War was about supremacy between two different blocks one led by USA and other by USSR. The end of the Warsaw Pact was the final act of the Cold War as there was no other party to challenge the American supremacy. Even the Soviet leadership, which agreed on dissolution of the Warsaw Pact, had acknowledged the end of the Cold War as their military alliance was gone. Soviet Union lingered for couple months before it finally collapsed on its own social, national, economic, and political problems.
The end of the Cold War can be traced to several events in the 1980's that eventually culminated in 1991. The Polish election of non-communist government and the fall of Berlin Wall in 1989 where one of these events. Other were a withdrawal of Soviet troops from Afghanistan and Central Europe. The revolutions in 1989 and unification of Germany in 1990 did not ended the Cold War yet. USA, NATO, and USSR still believed that there is some way to preserve the existing status and did not understand that the changes were permanent and irreversible because many still had in memory of Soviets takeover of Czechoslovakia in 1968 and Hungary in 1956. It was until Hungary officially placed its notice on the withdrawal from the Warsaw Pact (and was even warned by USA that it would jeopardize peace and security in Europe), and this call was collectively supported by Poland and Czechoslovakia in 1991.