How many ‘wp_insert_post’ calls can be performed in one shot, in a very long ‘for’ loop?

Something tells me that it could be the maximum script execution timing out perhaps. The amount of memory your inserts are consuming could also be the culprit. Are you getting any error messages, blank screens or anything like that?

You could try adding the following above where you’re calling the wp_insert_post() function:

set_time_limit(0);