Which one is a question that perplexed me for some time and still does under certain circumstances. If you have a photo of your dog, a JPEG is probably the best way to keep the resolution clear and the size down. If you have a drawing of a dog, a GIF will probably offer the best size to clarity ratio. Keep it small. It means that the file size needs to be small.
Small files transfer faster on the Internet.
Saving your GIF with fewer colors will help keep the size down. That saves a lot of room. Normally you will see very little change in the clarity. If you have a large full color picture of Bigfoot that you took on vacation, make sure and prepare a small version, maybe 2 inches square, that people can click on to see the larger version. Forcing someone to download a 500 kilobyte picture of Bigfoot won't make any friends.