the main difference in the file formats you mentioned is in the way that they save the picture information. for example in bmp format you save information about all the pixels, one by one. but i.e. in jpg format you some how compress the data in the pics using some standard algorithms and then save the reduced size. you can find many information on these standard algorithms on the web.
GIF stands for Graphic Interchange Format and was standardized by CompuServe in 1987. The very first GIF format was GIF87a and saves images at 8 pits-per-pixel with a colour level of 256. Then in 1989 CompuServe updated the GIF format to include animation, transparency, and interlacing, which was called GIF89a. Apart from animation, transparency, and interlacing there is little difference between to two.
JPEG
The JPEG image format was developed by Joint Photographic Experts Group. JPEG's best feature is the compression, you can compact the image file to make it the size smaller (bytes). The problem with this format is that there is a trade-off details detail and size. Generally its best to save JPEG's at 50% compression.
Bitmaps
Bitmaps was invented by Microsoft (everyone's favourite company). The Bitmap format saves your image pixel for pixel, in other words, what ever you see on the screen before you save is what you see when you open the image again. The only drawback is that the file sizes can be extremely large, which may result in longer download/upload times
there are many Image compression algorithms/techniques. please checkout the following links for more information on the Image file formats: