The manufacturer of the product should spell out what is the best resolution, depending on their printing process. Typical great resolution for a printing process is ensured by having source images at 300 DPI or dots-per-inch. In the case of digital images this means 300 PPI pixels-per-inch. Inpractical terms this means that if the magnet is 3"x4", the source image should be 900 x 1200 pixels.
Typically increasing source resolution above 300 does not produce discernable better output unless professional artwork output for which 600 dpi maay be best, sometimes even 1200 dpi. For reproductions not on high quality photo paper (or equivalent) you can drop resolution of the source to about 120 dpi.
If unsure and the manufacturer does not provide guidelines, it is best to experiment with a few tests to ensure the results will meet your expectations.