Polished stones, such as marble, travertine and granite, do not usually need to be sealed before grouting, because the polished nature of the surface lends to easy grout clean up. The polished surface is generally free of porous tendencies, which means the grout will not quickly dry up when left on the surface. While you can seal raw, polished stones out of personal preference, it is not a requirement for grouting.
Certain raw stones can be sealed during the pre-installation phase simply because they are so porous that they will nearly instantaneously suck the moisture out of the thin-set mortar and grout when they are applied to the stones, which can lead to grout failure as a result of rapid curing in hotter climates. Tumbled stones and clay tiles are good examples of tiles that can be sealed prior to an installation to avoid problems with the thin-set mortar and grout curing process.
The porous nature of slate, travertine, tumbled marble and granite and other types of raw stones means that the grout naturally tends to dry more quickly on the surface when compare to man-made tiles, such as ceramic or porcelain.
Sealing the tiles after they have been installed, but before they have been grouted, can make the grouting process easier, as the sealer will help the grout retain its moisture, thus avoiding rapid drying and difficulty in cleaning the grout from the surface of the stone.
While you can seal any type of raw stone with a penetrating sealer prior to installation or after the installation before the grouting process, it is important to never use a surface-based finishing sealer until after the grout has been applied. This is because finish sealers create a moisture-proof barrier that can keep the grout from bonding to the sides of the tiles within the grout joint. Penetrating sealers are fine because they work within the stone itself to create a moisture barrier, but surface sealers coat the stone in a protective layer.