This command enables and disables (toggles) 'god mode'. In god mode, most stats including health, stamina and Magicka are infinite and will not drain. Your character's speed will no longer be affected by the amount of weight he/she is carrying.
If god mode is disabled, executing the above cheat will enable it, making you invincible. If god mode is already enabled, this command will disable god mode.
ToggleGodMode is simply a longer version (alias) of the TGM command - it has the exact same function.