This post. :p
Both mechanics are broadly similar, and can only be used in PVP, the Battle Tower, or certain important story battles such as Gym Leaders. You may activate Dynamax or Gigantamax once per battle, on amy Pokemon. Doing so requires no held item, meaning that you can choose what to Dynamax on the fly.
Maxing lasts for three turns, or until you switch out. A Pokemon has a Dynamax level, which can be increased with Dynamax candy and goes up to 10. To begin with, Dynamaxing increases your hitpoints by 50%; when fully levelled, it increases your HP by 100%. Contrary to rumour, no other stats are boosted with either mechanic. Additionally, you cannot be flinched while in Dynamax form, to stop your opponent stalling with Fake Out etc.
The other benefit of Maxing is Max Moves. These are generally more powerful than a Pokemon's normal moves, and work a lot like Z-moves did, but are not as strong as Z-moves. Instead, their big use is in the various secondary effects that each type's Max Move has. For example, Water's sets rain, Grass sets Grassy Terrain, Flying boosts your speed, and Normal reduces the opponent's speed. Each type has a move which either raises your own stats, reduces the opponent's stats or sets a field effect. Whichever type you use, the effect applies to both Pokemon on the relevant side in a Double Battle.
Gigantamaxing is functionally the same thing as Dynamaxing, except that instead of just turning into a bigger version of the Pokemon, it takes on a different visual appearance. Only a few species can Gigantamax. The mechanical effect this has is that instead of a generic Max Move, one of its types of Max Move gets replaced with G-Max moves, with a special effect unique to that Pokemon in addition to damage. For instance, Charizard's sets Fire Pledge, Drednaw sets Stealth Rock, and Lapras sets Aurora Veil. These aren't necessarily better than the normal forms but give other options. Only certain members of that species can Gigantamax; raids give a random chance of encountering them, and are the only known way to find Gigantamaxable Pokemon.
One final note is that the Poison and Fighting Max Moves increase your Special Attack and Attack state respectively. To stop this getting too outrageous, Max Moves of those types are significantly weaker than Max Moves of other types.