Minecraft wiki entry for Structure_Block, associated text: Save
When all coordinates and a structure name have been entered, press this button to save the structure to a file. The name of the structure is the name of the file.
Structures can be saved to a file on disk only by manually pressing this button. If a structure block in Save mode is instead powered by redstone, the structure is saved only in memory by default. This is the case even if a file for that structure already exists on disk. Reloading the world clears any structures stored in memory. In Bedrock Edition, the player can set up the structure block so that it saves to the disk even when automated with redstone.
By default, structure blocks are saved in the minecraft namespace. This can be changed by prefixing the structure name with <namespace>: in the structure block.
In Java Edition, structures are saved in .minecraft/saves/(WorldName)/generated/(namespace)/structures. [note 1]