Very GIS program handles this differently, so go with whatever the gis program goes.
Importing height data for all of spain and visualizing it is possible - the programs scale the files on the run to do so.
Exporting it out (as png16 or more commonly tiff) is where you start to hit issues since the final file size needs to be something which your computer can handle.
At times, for things like the 256km^2 area its best to try and export one unusable heightmap and process it via command line tools which will never even attempt to load the whole thing into memory (that is your hard limit btw, ram).
The whole thing is also around 120GB of a file, so you need the hardware to be able to manage it and a couple days of time to write it to disk and process it…
NIP2 is an example of such a tool, but there’s likely a month of learning and fiddling around with the GIS program before you even get to this stage.
Work small, on small size areas until you figure out how things work.
Expand the size after, when you need to introduce other programs/knowlede.
The nice thing about working in GIS when you learn it well is that it is incredibly fast and saves most things (vectors) in microseconds.
Usually its also a non permanent modification since science-wise you usually always want to preserve the initial datum…