You can manage product image settings from WooCommerce > Products > Display > Image sizes. If you want to have all the images with the same size you can enable Hard Crop option for the catalog images. After that you need to install, activate Regenerate thumbnails plugin and regenerate thumbnails.
Here you can find WC plugin documentation about image sizes https://docs.woocommerce.com/document/fixing-blurry-product-images/
But we would recommend to use graphics editor and prepare images before uploading it to your media gallery, then your grid will look much better than if you use crop option