How long does one need to keep the original data of a study / publication? Most journals require to make data available at the time of publication (repository / upon request or similar). But for how long does the data need to be kept (field of on (bio)medicine)? This would especially be interesting in relation to the scientific wish to keep the data forever vs the General Data Protection Regulation (GDPR).

Journal guidelines as below seem not to specify this ...


https://www.nature.com/nature-research/editorial-policies/reporting-standards
https://authors.bmj.com/policies/data-sharing/
This is a question you should ask the funding agency that is paying for your work. They usually have requirements for how the data that is produced should be handled.

As an example, this is what the main German funding agency DFG says:


  Den Regeln der Guten Wissenschaftlichen Praxis folgend sollen Forschungsdaten in der eigenen Einrichtung oder in einer fachlich einschlägigen, überregionalen Infrastruktur für mindestens 10 Jahre archiviert werden.


My rough translation:


  Following the rules of good scientific practice research data should be archived in your own facility or in a topically relevant national infrastructure for at least 10 years.


There are certainly different considerations when the research data contains private information, e.g. patient data. I can't say anything about the regulations there, I'm only considering public research data that doesn't have any privacy implications. 

In general the scientific community benefits if the data remains available forever. And while the 10 years in my example are a minimum, many parts of the produced data like the publications and depositions of structured data into repositories like crystal structures to the PDB remain archived indefinitely. And many repositories like the PDB are steadily increasing the amount of raw data they would like to get along with the final output.