The file used to change various GRUB 2 settings is /etc/default/grub. This file also contains options to adjust the timeout in seconds before GRUB boots the default OS (GRUB_TIMEOUT), change which OS should be selected by default (GRUB_DEFAULT, first entry being 0), and also the option to change the resolution used by default – GRUB_GFXMODE.
In order to change it, edit this file as root with a text editor, e.g.:
Then find the option GRUB_GFXMODE and insert your preferred resolution, e.g.:
Now save the file (Ctrl+O followed by Enter if you used Nano for editing), and issue the following command in your terminal:
This should be all, the next time you restart your computer the new resolution should be changed.