Storage paths are configured in Settings → General → Files.
Step by step
Temporary files use the local cache and are removed after leaving the room.
Permanent files are saved to the selected folder.
Permanent transfer sends the original file without compression; the recipient chooses where to save it.