how to set category name for a post

The post_category parameter has to be an array of IDs (int).

http://codex.wordpress.org/Function_Reference/wp_insert_post#Parameters

Try get_category_by_slug to get the ID, then use it.

$category = get_category_by_slug( 'your-category' );
$new_post = array(
       ...
       'post_category' => array( $category->term_id )
    );

Alternatively, look into wp_set_object_terms or wp_set_post_terms, using the $post_id of the post you’ve just created.

If you need to add a category that is non-existent yet, create it using wp_create_category.

Good luck.

error code: 523