The difference lies in the compression techniques used to store images in a file, both file formats do it differently. GIF looks for lines of horizantal pixels all with the same colour and compresses them (Run Length Encoding - RLE), while JPG looks for patterns in an image and stores the image in a highly complex format which on each compression it forgets little bits of the image. This type of compression is called 'lossy' each time the image is saved it loses a little more of the image information until the image becomes a blur.
Technically, there is a difference between gifs and jpgs. So which one should you use?