The following quotes the article linked below (by Ofnuts): https://www.gimp.org/tutorials/ImageFormats/
● The Native GIMP image format. Everything is saved: layers, selections, channels, paths and more.
● Not a “display” format, even if you can find codecs to display thumbnails of XCF image in file explorers.
● Bulky.
● Color channels are coded in 8 bits (in GIMP 2.8).
● Saving all GIMP work.
● Compresses the files quite efficiently.
● Universally supported for display.
● Compression is “lossy” and it slightly alters the image data. In case of global changes (color, contrast…) repeated file editing will slowly degrade the image quality.
● At good quality levels, compression is invisible in photography, but can be seen (so called “artifacts”) in computer-generated graphics and text.
● Doesn’t support transparency.
● Color channels are coded on 8 bits.
● Display of photography
● Storage of photography
● Lossless format, all pixels are kept.
● Supports partial transparency.
● Produces small files with most computer graphics.
● Supported by all browsers.
● Complex images (photos) are bulky.
● Color channels are coded in 8 bits.
Web page widgets: banners, buttons, frames, etc…
Computer graphics.
Screenshots (unless this screenshot contain mostly a photo).
● Universally supported for animation.
● Only 256 colors per image, leads to blocky look. (a modern variant supports 256 colors per frame, but GIMP doesn’t use it).
● Supports transparency but only as fully transparent/fully opaque.
Small animated images. (in all other still-image uses PNG is a better alternative, and for bigger animation modern HTML supports video)
● Lossless format, all pixels are kept.
● Color channels can be coded in 16 bits.
● Can store several images (layers).
● Supported by all image processing software.
● Can be bulky on complex images.
Storage and exchange of high quality images.
● No loss of information from the camera sensor (in theory).
● High-depth color channels (12 or 14-bit).
● Proprietary (except DNG).
● Content format can change without notice (new camera models), this can impact support by your favorite software.
● Bulky.
● Not suitable for display.
Storage of camera output, but a secondary copy in some universal format could be a good idea.
There are of course many other image formats, but the formats above cover most uses. Use them unless you know better, they can usually be converted easily to any other format should the need arise.