Your problem is that you limit the number of posts before your conditional loop.
The line $loop = new WP_Query( $args );
returns a max of 8 results for your loop to iterate.
You could return the whole set of results and limit it yourself with a counter:
$args = array(
'post_type' => 'product',
'posts_per_page' => -1 //return all posts
);
$loop = new WP_Query( $args );
//create a counter
$count=0;
if ( $loop->have_posts() ) {
//loop whilst we have posts and we still require more
while ( $loop->have_posts() && $count < 8 ) : $loop->the_post();
if (get_the_title($post->ID) == 'Kompozycja 7' || get_the_title($post->ID) == 'Kompozycja 2') {
woocommerce_get_template_part( 'content', 'product' );
//increment count - if it reaches 8 we quit the loop
$count++;
}
endwhile;
} else {
echo __( 'No products found' );
}
Although if you have many thousands of products this will be slow. There is propably an argument you can pass to WP_Query instead to perform this check at the database.