When a JPG is not the right format
JPG is the default format for photographs: it is small, supported by practically everything and produced by almost every camera. It is also lossy, has no transparency and cannot animate, so there are times when another format is the better container.
Choose PNG when a picture will be edited and re-saved repeatedly, since a PNG does not lose quality each time. Choose WebP when the picture is going on a website and you want pages to load faster.
Both .jpg and .jpeg work
The two extensions mean the same format, and the converter ignores the extension anyway: it reads the first bytes of each file to recognize it. A phone photo saved in HEIC is a different format and is not supported.