St. Basil's was built to commemorate the capture of the Tatar stronghold of Kazan in 1552, which occured on the Feast of the Intercession of the Virgin. The cathedral was thus officially named Cathedral of the Intercession of the Virgin by the Moat (the moat being one that originally ran beside the Kremlin).
But the cathedral was popularly known as St. Basil's Cathedral, after St. Basil the Blessed (a.k.a. St. Basil Fool for Christ; 1468-1552), almost from the beginning. Basil impressed Ivan in 1547 when he foretold a fire that swept through Moscow that year. Upon his death, Basil was buried in the Trinity Cathedral that stood on this site at the time.
The Cathedral of the Intercession a.k.a. St. Basil's Cathedral was constructed from 1555 to 1560. Legend has it that after it was completed, Ivan had the architect blinded in order to prevent him from building a more magnificent building for anyone else. (In fact, he went on to build another cathedral in Vladimir.)
In 1588, Tsar Fyodor Ivanovich added a ninth chapel added on the eastern side to house the grave of St. Basil.
In modern times, St. Basil's came very close to falling victim to Stalin, who resented that it prevented his soldiers from leaving Red Square en masse. But the architect Baranovsky stood on the cathedral's steps and threatened to cut his own throat if the masterpiece was destroyed and Stalin relented (but punished Baranovsky with five years in prison).
More recently, St. Basil's Cathedral has suffered significant damage from weather and neglect. It was not until the Millennium that funds were allocated to restore its foundations and flaking surfaces.