If you use Poedit it will generate a .mo. and a .po file. The .mo file is used for the actual translation so you need to replace both existing ones.
I want to change the text of h2 tag "Gallery" of index page.
Well, what theme? Not all third party themes support gettext translation and not all strings are gettexted anyway. "Gallery" may also often the standard site title if you didn't name it otherwise.
EDIT: My colleague just reminded me: In PHP 7+ there seems to be an issue with refreshing changes in these file. This is as far as we know a PHP core / server side problem we cannot do anything about so far.
Apparently there's a bug in the Apaches' mod_perl module which causes translations not to work. You can try to disable the mod_perl module.
See: https://www.claudiokuenzler.com/blog/1023/php-gettext-translations-not-working-apache-mod_php-cli-works
This bug also affects our own current local MAMP environment.