There are many image file formats lurking out there in the digital jungle and it'll be good to know a few details about some of the more common ones.
JPEG (Joint Photographic Experts Group):
The most common file type found in your digital cameras, smartphones, online or on your hard disk. Jpeg is lossy image compression. It means that when you save an image file as a .jpg (and every time you edit and save it), it loses some pixel information that cannot be recovered. Fortunately image editors allow you to chose the compression/ quality level while saving the file so you could chose for maximum quality for least degradation and maximum compression for useless good for nothing frikin images. Jpeg support 24 bit color (or 'millions of color').
(Below - Jpeg 1:1 comparison of least and most compression)
JPEG 2000 provides both lossless and lossy compression options. Even for lossy compression, images are better with fewer artifacts compared to the original jpeg compression. Though many image editing softwares like photoshop support Jpeg 2000 standard, it is still uncommon and I have not seen it offered in any digital cameras yet.
TIFF (Tagged Image file format):
TIFF supports up to 48bits data compared to 24 bits in JPEG in RBG mode. TIFF files are normally uncompressed (and large) but if you have tinkered with TIFF, you would have noticed the LZW lossless compression option while saving. LZW compression works better for graphics rather than photographs and it may cause compatibility issues if someone tries to open a LZW compressed file using a program that does not support it. As far as digital images are concerned, TIFF is one of the best archival file format.
GIF (Graphics Interchange Format):
It's one of the most popular image formats on the web but you'll probably never use GIF format to store your digital photographs. GIF comes in handy for making a banana dance (It supports animation). GIF images are compressed using a lossless compression technique (LZW). GIF is limited to 8 bits only (256 colors) and it's use mostly limited to web or clip art.
PNG (Portable Network Graphics):
Another popular image format that supports 24 bit RGB and lossless compression. It's an open source standard hence royalty free. And if you love GIF and it's support for animation but want more than 256 colors, PNG's cousins MNG and APNG can give you animated images in glorious 16 million colors. PNG's lossless compression is better (smaller file size) that TIFF LZW and could be used as an alternate for TIFF. Compared to a JPEG, PNG files are much larger for photographic images but PNG compressed files for Graphic or line art images are much better in size and quality compared to JPEG. PNG also supports transparency unlike JPEG.One disadvantage of PNG compared to JPEG is the lack of a standard for embedding EXIF image data; the lack of which I don't think any photographer would like.
WebP is an open source lossy image format developed by Google. As the name implies, it is optimized for web and claims smaller files sizes and comparable quality to JPEG.
BMP (Windows Bitmap)
I don't think anyone uses it anymore but I got to mention the old guy. It's an uncompressed file format and hence huge. Thats about it.
The bottom line (and it's subjective)
For digital photographs- TIFF is better for archival and JPEG for sharing
For Graphics or Line art - Compressed TIFF or PNG