The difference comes when e.g.
gedit writes a preference file or something similar to
$HOME when it is closed. Many programs do that.
When you run
sudo gedit ...
$HOME is still set to your home directory (say
gedit will write its settings there but the preferences file will then be owned by
root. This might make it difficult to run
gedit as your user afterwards because then
gedit cannot write its settings due to a lack of permissions.
When you instead run
sudo -H gedit ...
$HOME will be set to
root's home directory (usually
gedit will write its preferences file there without affecting your account.