JPEG is best for photos because it makes the file smaller, but it can lose a little quality.
PNG is best for logos, text, or images that need a clear background, because it keeps the quality perfect and allows transparency, but the files are usually bigger.