Posts are never automatically deleted based on time. Other factors, such as questions with no answers and no upvotes, or questions that are downvoted and closed, result in deleted posts. But older, relevant questions are not deleted just because they are inactive. They can be deleted if a moderator chooses to, or very high reputation members vote to delete on a closed question, but there is no automated deleting of posts.
One reason for that is that the information in the post, despite being an inactive post, is probably still relevant, even if there are no new answers or edits made to the post. And many people find their way here from Google searches, where posts are indexed.
Any old posts that are no longer relevant can be flagged for moderator attention if you don't have the privileges to vote-close or vote-delete.