Add Fields to Field Group programatically
This is a bit old, but I wanted to do the same thing and couldn't find an answer on the web. I ended up figuring it out by myself.

Let's suppose you created a field group through the CMS interface with the name "group_product_fields". You added some fields to that group.

Now you have a new field being included in the form programatically via hook_form_alter. You want to add that field to "group_product_fields". Here is an example of what the field could be:

$form['new_product_field'] = array(
  '#type' =&gt; 'textfield',
  '#title' =&gt; t('New product field'),
  '#description' =&gt; t('Description for this new product field'),
);


All you need to do now is to add that new field to the field group. To do that add the line below to the hook_form_alter. It can be placed anywhere inside it.

$form['#group_children']['new_product_field'] = 'group_product_fields';


That's all. You may wish to adjust the field weight for it to be positioned as you want. But in the end this is really simple. :)