If you want both vim and gvim to use the same color scheme, place the configuration in .vimrc. Unless overridden in .gvimrc, gvim will use whatever is specified in .vimrc:
You can't have vim and gvim look exactly the same; vim, running in a terminal, doesn't have control over background color. Also, unless you're running a 256-color terminal, gvim has a lot more colors available to it for use in color schemes (that color schemes may or may not use). If you want them to look exactly the same, you may need to create/custimize your own theme.
So, if you have a terminal which supports 256 colors, set
before running vim and hope that the colorscheme XYZ looks the same in vim as in gvim :)