The answer you are looking for is... it is up to you.
Baseboards are there...
To make sure a wall does not get kicked or damaged at the bottom.
To hide flooring gaps.
For decoration
For a good excuse to buy a mitre saw.
Depending on the type of flooring you install you will want to adjust your base boards or even install different types.
Michael says you may need a base shoe - warning I am an anti-shoeite. Why why? Why the extra piece at the bottom that gets broken or comes loose. I have never been in a super upscale house and saw a shoe stuck to the bottom of trim.
So some guidelines:
Carpet = 1/2"... if you are getting some super dense stuff maybe a little more. If you are getting stuff that might not even be considered carpet (I call it astro-carpet) then maybe less. It should be tucked into baseboards. Meaning if baseboards install after you should slightly smash down carpet at edges.
Wood = You should be installing after and lay it on the wood. So not all floors are exactly level-perpendicular should you have have gaps underneath some sections. This is OK and aesthetically each wall should be laid out to look good and join at corners well. Note that if you are leaving 1/4-3/8" you have the option of getting trim that is thicker to cover this. You can also find trim that is thicker at the bottom, which is all you need.
Tile = You also should install it after as you should not be grouting between tile and baseboards. If you were a pro and had installed a certain tile before I guess you could leave the baseboards and slide tiles under... that is not normal though. For gap on tile I like 1/8" all the way around. Two reasons... It shows better. If one tile is slightly slightly higher you won't notice as much if baseboard was sitting on it. Also you won't notice grout issues or divots that are perpendicular to baseboards as much.
Vinyl/planking/engineered - treat these like wood.
I have done shoe moulding on two out of my last maybe 50 flooring remodels. One was because my guys had uneven and big expansion gaps (install mistake). The other the lady explicitly wanted it even when I tried to talk her out of it.
How big the gap is... well it really comes down to what looks nice? I would for instance welcome a larger than I want gap to forgo shoe moulding (I know those two are not really related).