Which hook is fired when inserting media into a post

The add_attachment action is fired when the wp_insert_attachment() function is called to add an item to the media library. Images are added to posts after going into the media library first. Even when adding via the post editor, items are added to the library with wp_insert_attachment() then to the post.

add_action( 'add_attachment', function( $post_ID ) { 
    // Do Stuff
});

This will not allow you to number items by post, only by instance in the media library. Whether that works for your purposes, I cannot answer.

https://codex.wordpress.org/Plugin_API/Action_Reference/add_attachment