The gif format is used for images with few colours. Think for instance of a logo or a text-only banner. Just like a .jpg, the gif format is intended to compress images. The compression is achieved by, among other things, reducing the colours to a maximum of 256. This type also supports transparency. But the result of a .gif image with transparency is often sub-optimal (see example 2 at the bottom of this blog).
Instead of a .gif you’re better off using a .png. The big advantage of the gif format over the .png is that .gif also supports animation. Everyone remembers the nervously blinking images you used to find on web pages. This may have become a faux pas, but animating an image does give you the option of alternating products in a banner, among other things. Of you can subtly focus attention on a product by turning it in to a ‘cinemagraph’.