Stamford and Cambridge are really quite different.
For cycling, Cambridge is the place, there are thousands of bicycles occupied by nearly as many university students and residents, plenty of well marked bicycle lanes, and you can get to and cycle through for example the Backs all the way down to Grantchester and back around passing by the various sports fields, and you can follow the river. Very scenic very nice.
Get a nice tea or drinks or a meal at the Orchard Tea Garden https://www.theorchardteagarden.co.uk/ at the bottom. Hammock or chair under the trees. Or pull up a blanket and have a proper picnic.
Stamford is chock full of local limestone buildings, many Georgian, with Collyweston Slate on the roofs, very picturesque.
But other than going to the magnificent Elizabethan Burghley House not a great deal to do around here. You can walk through the water meadows and probably cycle around there but I have never tried. Stamford is significantly less well located for getting out into the Fen countryside although it is of course better for Northamptonshire and Lincolnshire.
Both are in or near the Fens, cycling in which takes some skill, be careful not to ride too close to the bank or you are likely to wind up in the river or drain which has killed many people every year who fall off the road either by car, motorcycle or cycle. You may not believe quite how bumpy the Fen roads are because they are built on the peat which subsides and expands differently depending on the moisture it is holding.
As far as history, both are dripping in it. But Cambridge history is easier to find. Many more choices for food and drink in Cambridge.
Hard to go wrong either way - but they are very different.
Wish I knew how to change my name on this forum!!
When you are logged in, hover over "My Account" then click on "Travel Forum", then scroll down to the bottom to "My Settings". Click on "Edit Forum Settings", and you see that you can edit what you call yourself.
Sounds complicated, but not really bad.