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.