When you download a media file, it'll automatically be saved to your phone's default storage. It's not possible to stop media from being stored on your device after download, but you can stop media from showing up in your gallery.
To do so:
If you wish to see downloaded media in your gallery once more please check this box.
To adjust this setting for an individual chat:
Note: The Show media in gallery box will be checked by default.