If you know exactly what you're doing, feel free to use -y. Personally I like having the option to abort, so I seldom use it.
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and run
non-interactively. If an undesirable situation, such as changing a held
package, trying to install a unauthenticated package or removing an essential
package occurs then apt-get will abort.
If you have the gimp PPA (I'm assuming there is one, haven't looked), apt-get will install the most recent version of gimp from it.
And if I did use that command, would Ubuntu have tried to install from both the GIMP and Ubuntu repositories?