Is there a setting to prevent old topics from getting bumped after n days?

This would practically make all “older” topic die out. You would only get newly created topics and those without any “gap” or “cooling period” (when there was no replies), in your latest. It would seem to go against the usual wish to not always create new topics, but first search for existing ones to continue, doesn’t it? But maybe you do have a use case for this. (I can see how your latest may start to dry out if there isn’t enough new topics or topics with constant replies, though).

I am not aware of any setting allowing this (=If I’m not mistaken, there isn’t any. As said, it seems rather counter-intuitive to want to run a forum this way, except special use case). You could achieve this with some custom coding/plugin.

Note: I had created a topic about bumps when its last post is edited, but this doesn’t seem what you’re after at all. ( "No bump" option when editing last post in a topic? )

EDIT: I’m just thinking about this: The functionality telling you there is already some existing topics when you want to create a new one would even seem to go against what you want to do.