How Can I Set the Post Author of a Post I Just Created With PHP?

If you know the ID of the author you can use wp_insert_post specifying the ID and the author ID to it.

$id = $post->ID; // change this to whathever
$user_id = '4'; // change this too

$the_post = array();
$the_post['ID'] = $id;
$the_post['post_author'] = $user_id;

wp_insert_post( $the_post );

The trick is to specify the ID to update the post. See wp_insert_post().