Where is the group of a fields group stored in datababase (to get it programatically)?
I have never used field_group module, but your approach seems wrong, looking in the database doesn't help often.
I suggest you should install the module devel, turn it on.
Then use the function dsm() to see the content of your node/form that you are in.
If I assume you are in the hook_form_submit() to process something, dsm($form_state), if you are in another hook with a node as parameter of your hook, just dsm($node), you might find what you are looking for.

Cheers