For a still image like that, just use File>Save for Web. In the file type or preset choose gif.
Same goes for a video, use the save for web to export an animated gif. Just make sure your timeline has an animation or video in it, or it will not work.