Environment variables are inherited from parent to child. If you open a shell (bash) in a terminal in a graphical environment, this shell is a child of the process that runs the graphical environment. Therefore, any environment variable that you define or change in your terminal will only be seen in that terminal and in the child processes of that shell.
If you want a modification of an environment variable to be "global" and / or "persistent", there are several alternatives according to your scenario.
One is to set the variable in the user initialization file that will open the terminal. For example, in ~/.profile
These settings will be applied every time the user opens a new shell (in graphic terminal or not).
The other is to set the variable globally, at the system level. This can be done (in Ubuntu and several other Linux) in the files
/etc/profile.d/*.sh
or
/etc/environment
For details, see the documentation here .