Maceration is the process where the skins and juice hang out together after the crushing of wine grapes, and flavor compounds, tannins, and color compounds are leached into the must (juice).
Generally speaking (there are always exceptions to the rules) red wines macerate until fermentation is complete. Sometimes to intensify the final wine, some of the juice is pulled off to increase the intensity of the maceration process on the final product. Furthermore, in some cases the juice that’s been pulled to aid in intensifying a red is used to make a rosé (saignée method). When rosé is the intention of a winemaker, the maceration process will only last for a short period of time, dependent upon the desired tint and tone the winemaker is hoping to achieve. It is rare for white wines to undergo maceration with the exception of varietals that have juice that is thin or not flavorful by nature, these whites will be macerated to extract flavors from the skins, good examples are Semillon or Sauvignon Blanc.
Heat can play a big role in maceration as that is the trigger beginning the fermentation process. During this time carbon dioxide is produced, pushing the skins to the surface of the vessel (known as the cap), and oftentimes a winemaker will push the cap back down to continue contact with the juice.
When a winemaker wants to macerate without fermentation, the cold maceration process is used. The vessel is kept at a temp below the point where fermentation begins, then the winemaker removes all the skins from the vessel, and finally begins to warm the infused juice and begin fermentation post-maceration.