I check the prices a couple times a year. If a set is flat, I dump it after a year. Maybe it'll go up, but maybe it will be the next Birds, Exosuit, Women of NASA, etc... just taking up shelf space.
If it climbed, but has since leveled off, also a good time to sell. Super Star Destroyer, Grand Emporium, etc... would be a good examples (ignoring what they did this past year).
If it took off like a rocket with irrational exuberance, might want to pull the trigger quick -- I'm looking at you, Seacow.
Everything else, is up to your cash flow needs.
In my spreadsheet where I track all my sets, I have the sale price column and the date sold right next together. Most of my sales are on ebay and I list one set at a time, and I'll price the next set based on the trend that I'm seeing. It's depressing when I see sets selling for $350 two weeks before Christmas that were selling for $250 two weeks earlier. Ya, you'd wish you had held onto those sets and sold them later, but that's how the dice rolls sometimes. My solution is to "simply" stock enough sets that I can get some quick returns early, but also have the reserves to participate in the long game. For me, that means where I might have considered 10 of a set to be a good reserve with large diversification, now I'm looking at 30 to 50 in a smaller variety.
Similarly, if it is going up, consider why. Is it FOMO driven -- if so, sell quick. Is it part of a long-term collectible series (winter holiday sets, architecture cityscapes) where new incoming participants want to catch up -- then it'll probably only continue to increase and you might want to hold longer. If it is part of a series that has been cancelled -- such as sets based on a particular movie -- then the demand might wane and you'll wish you had sold earlier. And then there are the classics -- look at the price history of 10223 or any of the 7040X castle sets. When you think of LEGO, how can you not think about Space and Castles? As long as LEGO doesn't introduce a new castle series, nostalgia will continue to drive these up and you should probably hold onto a couple of them.
And then there is the exit plan. How much can a set go up after all? If it's already 5x its original MSRP like some of the castle sets, then do you cash out or keep betting? I don't know of many people who will say, "Oh, why did I sell for 400% profit when I could have made 900% profit?" You're more likely to hear, "Why didn't I take my 400% profit before LEGO decided to reissue the same set this year and now I only doubled my money?" It's a lot safer to take that 400% gain and reinvest it in the next set that might go up only 50%, but is not very likely to drop 50% after retirement. Also, at some point, folks will Bricklink a set if they are willing to spend 5x MSRP. I picked 5x just because that's a fairly extreme gain that not many sets will hit. Personally, if I have a set that has hit 3x MSRP on ebay, I'm more than happy to sell and never look back.