No, it's not forbidden per se, but as Joe C mentioned, the security concerns of the Prime Minister cycling in London probably make it more trouble than it's worth. On the other hand, Johnson has often been walking & jogging in St James' Park since becoming PM.
This theory is, however, backed up by the Guardian, which reported in December:
He was forced to give up cycling around London when he became foreign
secretary and then prime minister because of security precautions.
Forbes also mentions that this has precedent:
Like David Cameron, the previous bicycling prime minister, Johnson has
had his wings clipped by security officials, and he is ferried around
in armored cars rather than be allowed to cycle on London’s streets.
I would think that a large reason is that the optics of cycling while followed by an entourage of pool photographers, security, and advisors are not ideal, and the PM is probably trying to avoid a similar mishap as befell Sadiq Khan, the current Mayor of London, in May.
London Mayor Sadiq Khan has been spotted out cycling in the capital
today, closely followed by his security team in a £300,000 armoured
car - after commuters were last week told to ditch public transport.