There is no right or wrong answer and all investing is a gamble as to what the future will hold, you use your knowledge, experience and information you have access to to change the odds more in your favor.
Typically once a set is retired it will have a spike in price, then will slowly increase in price for 3-5 years. At which point most sets fall out of demand, why? maybe the theme is old and boring, maybe new pieces or colors have been released making that old set undesirable, in the case of themes like HP and SW sets are often reproduced like the multiple versions of the xwing, in the case of pirates and trains newer sets are bigger and better and people dont want the old sets, the santa fe was the most expensive hard to find train at one point but when the maresk train came out the santa fe dropped in value.
So how long should you hold? no one has a crystal ball, but from my experience most sets are ripe for picking around 1-2 years at which point if my inventory is full i will sell to make way for new sets, i recently have cleared out many of my imperial shuttles, emerald nights, maresk trains, etc... to make room and fund purchases of LOTR and other newly retired sets, sure those older sets my appreciate more still but the profits and space was used to buy heavily discounted newly retired sets that i feel will have a significant ROI in 1-2 years. I would rather have a 100% ROI in 1-2 years than a 200% ROI in 3-5 years, sure the 200% ROI is better but in the same time period i can do multiple 100% ROI sets, so no i dont get the "peak" price of the set but thats ok because ive sold multiple sets and totaled many times more profit. Plus for those who have a nagging wife like me, i have to show her that im selling sets on a regular basis or she gets cranky and sceptical of my alternative investment strategy, often i just rearrange my boxes to make it look like ive been selling when i really havent haha.