There is no optimal size. The image size depends on your needs and purpose. I would recommend to optimize images and upload them in one and the equal size.
In addition, you can set the rules for images here: Appearance > Customize > WooCommerce > Product Image.
Upload bigger optimized images and setting would customize as per your needs.