The Cold War lasted for a total of 45 years. This period of hostility short of open war between the United States and the Soviet Union lasted from 1946 until 1991, according to the National Museum of American History.
The Cold War started when the Soviet Union refused to recognize obligations incurred during World War II, including moving out of the Middle East and allowing Germany to be a free state. When the Soviet Union also acquired nuclear weapons, the two superpowers found themselves in a precariously balanced position. Neither one was willing to move openly for fear that the other would use those weapons. The Cold War spawned multiple small wars and conflicts, and it only ended with the collapse of the Soviet Union in 1991.