Setting a post’s category

Try doing this:

$insert_post = wp_insert_post(array(
    'post_author'=>1,
    'post_date'=>date('Y-m-d H:i:s'),
    'post_date_gmt'=>date('Y-m-d H:i:s'),
    'post_content'=>'',
    'post_title'=>'',
    'post_excerpt'=>'',
    'post_status'=>'publish',
    'comment_status'=>'closed',
    'post_name'=>'',
    'post_parent'=>0,
    'post_type'=>'portfolio', // with 'portfolio' custom post type
    'post_category'=>array($id),
));
if( $insert_post ) {
    wp_set_object_terms( $insert_post, intval( $id ), 'galleries');
}

Using wp_set_object_terms you can set the terms for the post in any taxonomy. The first argument is the ID of the post, the second argument is the ID or slug of the term, and the third is the name of the taxonomy. If you use an ID for the term, you must use intval() otherwise it will create a term that is just a number.