Not sure I fully understand what it is that you are asking for.
You say that you want to limit the number of topics in a forum - that would be relatively easy as an extension but then there is the question of what happens when that limit is reached? Do you just prevent users from posting because that is a sure way to drive users away from your board.
You then say
ankit_123 wrote: ↑Sun Nov 28, 2021 7:37 am
so that a specific topic does not become too large
This gives the impression that you want to limit the number of replies in a topic - not the number of topics in a forum.
So the question is which is it that you want - limit topics in a forum, limit posts in a topic or both?