OK, so not counting unusual guns / no longer made / collector pieces.....
It's a good question, and the answer depends on handgun or defensive rifle vs. hunting longgun, and just simply how much room you have in your house / safe.
First off, the values are ONLY going to go up, on ALL types of guns, so unless you need the money for a specific thing you need to pay for, or need the space they're taking up, there's no good financial practical reason to ever sell one. Similarly and relatedly, since we'll ALL presumably having more time to shoot them when we're retired than we do now (assuming you're not already retired), just not having time to shoot them is not a reason. You MAY just have plenty of time to shoot and enjoy all of them *someday*.
Secondly, assume that you have plenty of room for all of them. Then I look at hunting longguns and defensive guns slightly differently. I want no more defensive guns that I absolutely really need to "cover my bases", because the fewer designs/manuals of arms, and the more familiarity, the better. So I pare down to necessities there. I've got essentially just 6 "serious" defensive arms: 1 standard/always/deep concealment CCW, 1 bedside handgun, 1 pickup truck handgun, 1 backup pickup truck & CCW handgun, 1 home defense shotgun, and 1 all-purpose SHTF/militia type rifle.
As for longguns, there's always the "but this longgun is the perfect gun to hunt X species in Y state/country under Z conditions, or induct a noob into the shooting world, for me, my future wife, my friends & inlaws, or my nephews" syndrome, due to some little design quirk or caliber of the rifle. And I eventually want to hunt around the world. So I ain't selling these until my dreams are completely shattered and it becomes readily apparent (if ever) that that Africa trip, etc., just ain't never gonna happen. I'll just need one gun then, to Hunter Thompson myself.
If it doesn't get used it gets gone. Shooting is a verb!
I like that!