This is a very interesting question without a definitive answer. On Internet you can read various answers (for example, on SuperUser or storagecraft), suggesting something on the lines of 3-10 years.
However, at best of my knowledge no real scientific study was done on this very important question (especially on modern high density PMR drives), so all answer are basically handwaving. With that premise, I would like to bring to your attention the following points:
HDDs are mechanical devices that rely on the properties of a specific lubrificant fluid which, if left unused, dries-up. This means that an HDD left unpowered for years can have difficulties spinning up, in (rare) extreme case even causing some voltage spikes that can "toast" other devices connected to the same power rail;
magnetic strength degrades at a rate of 1% each year so, theorethically, after some decades it will become much weaker. As modern HDD uses an embedded, magnetical servo track which will itself degrade but you can not rewrite, after some years the head could have issues locking the track/platter, finally losing all access to the data (NOTE: to be clear, this applies to powered disks also).
My anecdotal evidence is that some HDDs (with capacities ranging from 200-1500 GB) had no problem with >1 year of unpowered storage. On the other hand, some other drives (1 TB 2010-era low power disks) shows uncorrectable errors / pending sectors after only some weeks of unpowered storage. Obviously, as all anectodes, I know this has no statistical value.