JPG is best for photographs as it can achieve high quality with heavy compression. It should not be used for images with uniform colors and sharp edges like line art. GIF is suitable for images with fewer than 256 colors and large uniform areas, while PNG supports more colors and is lossless, making it best for exact display of photographs or images with more than 256 colors.