In this answer it is mentioned that boiling with the lid on or off may make a difference in final gravity. Which do you recommend and why?
You want to boil with your lid off.
Part of the process of boiling is to remove dimethyl sulfide (DMS), which is a sulfur compound off flavor that tastes like cooked corn. DMS is formed by heating the wort. If you leave the lid on the kettle DMS won't evaporate with the steam and you'll have more of the flavor in your beer.
You might also run the risk of boilover if you leave the lid on, but DMS is the larger concern. This is also one of the reasons you want a real, rolling boil as it allows more DMS to escape.
I think the difference (regarding gravity) would just be water volume. Lid off = liquid lost to steam. You can compensate by adding more (or less) water after the boil.
The actual amount of liquid lost depends on the geometry of your kettle, but I think 1-1.5 gallons per hour is a rule of thumb. The easy way to know for sure is to measure before and after a boil.
There's an interesting experiment into this here https://brulosophy.com/2016/10/31/the-boil-lid-on-vs-lid-off-exbeeriment-results/
It's worth reading the whole thing but the TL:DR version is that he did side by side lid on and lid off brews which were otherwise identical, and nobody could tell the difference with blind taste/smell testing - even him. The two beers were for all intents and purposes identical.
One interesting thing is that both brews lost the same amount of liquid during the boil, and one of his theories was that even with the lid on a lot of steam still escapes, and that maybe still carried the DMS off with it. He did say he was going to continue doing lid-off brews though.