It is up to the researcher to determine for how long the study data should be retained. Any clinical trial with Health Canada oversight must retain the study information for 25 years. Apart from that legal requirement, it is a personal decision of the researcher.
For student studies we generally recommend 2-3 years, with the data then retained electronically by the Local Principal Investigator (LPI) after that. Or consider retaining the data for 2-3 years post-publication. Some sources now say data should never be destroyed, and that is certainly worth considering, given trends for combining and re-analyzing data sets.
Please note: Identifiable data should be destroyed as soon as possible. De-identified data may be retained indefinitely.