Foreign Secretary Liz Truss, Defence Secretary Ben Wallace and 10 other senior politicians - mostly members of the Cabinet - have also been barred.
Moscow said the decision had been made in retaliation to the UK's sanctions against it since it invaded Ukraine.
In March, Moscow imposed a similar ban against US President Joe Biden.
The full list is:
* Prime Minister Boris Johnson
* Foreign Secretary Liz Truss
* Defence Secretary Ben Wallace
* Deputy Prime Minister, Lord Chancellor, and Secretary of State for Justice Dominic Raab
* Secretary of State for Transport Grant Shapps
* Home Secretary Priti Patel
* The Chancellor Rishi Sunak
* Minister for Entrepreneurship, Energy and Industrial Strategy Kwasi Kwarteng
* Minister for Digital, Culture, Media and Sport Nadine Dorries
* Minister for the Armed Forces James Heappey
* First Minister of Scotland Nicola Sturgeon
* Attorney General for England and Wales and advocate general for Northern Ireland Suella Braverman
* Conservative MP and former British Prime Minister Theresa May
In a statement, Russia's foreign ministry said: "London's unbridled information and political campaign aimed at isolating Russia internationally, creating conditions for containing our country and strangling the domestic economy" were responsible for its decision.
It added: "In essence, the British leadership is deliberately aggravating the situation around Ukraine, pumping the Kyiv regime with lethal weapons and coordinating similar efforts on the part of Nato."
The UK government said it remained "resolute" in its support for Ukraine despite the move, adding that it condemned Russia's "reprehensible actions" in the country.
Scotland's First Minister Nicola Sturgeon also reacted to the sanctions, describing President Putin as "a war criminal" and vowing that she would not "shy away from condemning him and his regime".
Earlier this week, the UK and US governments announced further sanctions on Russia.
The sanctions included financial measures designed to damage Russia's economy and penalise Russian President Vladimir Putin, high-ranking officials, and people who have benefited from his regime.
Nato countries - including the UK and US - are also supplying weapons, ammunition and other military equipment to Ukraine, although they have ruled out sending in Nato troops or implementing a no-fly zone.
On Wednesday, the US said that more sophisticated offensive weaponry would be sent to Ukraine as part of a $800m (£612m) package.
In response, Moscow on Friday warned the US that there would be "unpredictable consequences" if it refused to stop sending weapons to Ukraine.
Retaliation of this kind was always likely. Russia sees the UK as one of the international actors most intimately involved in efforts to support Ukraine's militarily and isolate Russia economically and politically.
Russia's move is unlikely to make a difference to the travel plans of the 13 British politicians. It is unlikely any of them had a trip to Moscow in their diaries.
But it speaks to the Kremlin's growing anger at the way the West has responded to its invasion of Ukraine and its willingness to lash out against those who it sees as having played a role in isolating Russia in the past - Theresa May helped to orchestrate the mass expulsion of scores of Russian diplomats from more than 20 Western allies in the wake of Russia's use of a nerve agent in Salisbury in 2018.
Russia has warned that further shipments of Western military equipment to Ukraine could result in "unpredictable consequences".
Banning political leaders is not exactly unexpected. What worries officials in London, Washington and elsewhere is that Russia has the ability, and possibly even the desire, to resort to other military means, including the use of unconventional weapons.