St. Petersburg was founded (during the Northern War between Russia and Sweden) in 1703 by Peter I (Peter the Great), as an alternative capital to Moscow. Peter I wanted a more 'European' capital and based the city on French designs using Italian architects. In 1712 the Russian capital was formally moved to St. Petersburg, coinciding with Russian victory in the war and the declaration of the 'Russian Empire'. For the next 201 years until the start of the First World War St. Petersburg was the seat of all Russian monarchs and a centre of high society and culture (it was generally referred to only as 'Petersburg'). In August 1914 the Germanic 'St. Petersburg' was translated to a more patriotic Russian name, 'Petrograd' (
grad means 'town' in Russian.), as Russia was now at war with Germany. In 1917, after the November Bolshevik Revolution, the Russian monarch (Nikolai II) was deposed and soon after, in 1918, the Communist government transferred the capital back to Moscow, firstly because they hated the 'bourguoisie (sp?) decadence' of the city, and secondly becaue German troops were closing in on the city. Finally, in 1924, the city was renamed 'Leningrad' in honour of Vlaidmir Lenin, hero of the Bolshevik Revolution, to coincide with the new constitution of the USSR (Union of Soviet Socialist Republics).
And, as Dark Knight says, in 1991 in a referendum, the people of the city voted to revert to the city's original name, that of St. Petersburg, which it retains today.
That is correct to the best of my knowledge.

Haven't looked at Russian history for ages. Please correct me if I'm wrong