In addition to its ability to compress large graphic files, a single GIF can contain multiple images and display them sequentially making it a useful format for simple frame animation.
As with other types of animation, you first need to make a series of individual frames/drawings and then save them as a single GIF. Photoshop has tools that make this easy.
To export the animation, open Photoshop's Animation palette:
In the Layers palette, select the items you want to appear in Frame #1 of your animation.
In the Animation palette, create a new frame and, in the Layers palette, select the items you want to appear in Frame #2 of your animation.
Keep going until you're done. At this stage, this animation has a total of 5 frames:
Once all of the frames are in the Timeline, play the animation to test pacing. This animation needed a pause between cycles so an empty, 1-second frame was added at the beginning and a 1-second pause was added at the end.
Once the animation is tuned, you save it as a GIF using Save for Web and Devices.