How to Zero Pad in Order to Perform Filtering in the Fourier (Frequency) Domain?
The result of a convolution of a data vector of length M with a kernel of length G is of length M + G - 1.  (the maximum length of the non-zero portion, even though the limits of integration is sometimes written as from -infinity to +infinity)

This is clearly (G - 1) elements longer than the original data vector.

So where do these new, "extra", additional result values go?  If you don't zero pad when doing an FFT fast convolution, these "extra" result values simply get added into some portion of the first part of the length M convolution result, wrapping around the edge, which likely messes up your desired linear convolution result.

But if you zero-pad, then these "extra" values get added to the zero-padding, which is less likely to wrap-around far enough to mess up your desired convolution result.

Both are circular convolution, but a circular wrap into a bunch of zero-padding is far far easier to delete or remove, then when it's added into, and thus all mixed up with the results you most likely actually want.  e.g. becoming artifacts along the edge of your filtered image.

You have to zero pad the kernel to the same length as the data so that their FFTs also end up the same length, which allows straight forward multiplication of those 2 equal length FFT vectors, before IFFT-ing the multiplied result.

So, how much to zero-pad?  By any amount >= (G - 1).  Perhaps rounding up to the nearest size for which your chosen FFT implementation is performant, usually a size which is the product of only very small primes, such as 2 (and/or maybe 3, 5 or perhaps 7 as well).