Almost all of the main railway stations in London have left luggage facilities. However, unlike in some European countries, this is a privately run place that stores your bags, rather than lockers. The costs at all of the main stations are £12.50 for the first 24 hours, £7.50 per day after, and they round up (so the minimum charge is £12.50 for a bag). For most of a day, that doesn't seem too bad, but it feels a bit steep to me if I just need to stash a small suitcase for 1-2 hours...
Most of the main museums and galleries in London offer storage for coats and small bags (tends to be free at the paid for museums/galleries, a recommended donation of £1-£2 at the free ones). As an example, the National Gallery only allows bags up to 43 x 66 cm (17 x 26 inches). The British Museum only allows bags up to 40x40x50cm. In both cases, larger bags aren't allowed in the building. (Very small bags are normally fine, bigger ones up to the size limit generally have to be left in the cloackroom). Those sizes are a little smaller than most cabin baggage sizes.
If you have a small-ish bag with you, that's too big for museums, and you want to pop into a museum or gallery for an hour or two, is there any option other than going first to the nearest station and paying £12.50?