This doesn’t seem to be what you want to hear, but…
There is no physical limitation to what you can learn, you are only limited by your attitude. Plenty of people speak 7 different languages fluently, it all depends on your attitude and what your goals are.
Software-wise, there is also no limitation either. These are languages I know:
C++
Assembly
Ladder
C#
JAVA
Javascript
Typescript
Python
Ruby
SQL
These are frameworks that I know:
Selenium
Angular
Node
Kubernetes
The keyword here is know, which is different than mastered. Knowing something means you can read it and understand it, make changes to it. Mastering something is entirely different, you can master different languages it just takes a lot more time.
I’m not telling you this to brag about what I know, I’m telling you this because I say it on a lof of posts: You never stop learning, you need to be adaptable. A new language or framework is not created to screw with people, it’s created because it serves a specific purpose and it’s useful. As a software developer, you need to be able to adapt to the trends otherwise you’re going to be stuck professionally.
To answer your question directly: How many languages should you learn?
As many as you can.
If you ever feel that you already learned what you need while being in this profession, I’m sorry to say that your career is over. I’ve been in this field for close to 13 years and I constantly feel I don’t know enough. I’m always looking to learn something new, it is what has allowed me to be in the position that I am today. 6 years ago I left a wonderful job because I felt I was stuck, I didn’t have any opportunities to move up. All that changed when I quit that job and was forced to learn something new, 6 years later I hold the position of the person who didn’t know what to offer me in order to keep me as an employee.
Learning a new language will always give you a new opportunity, there is no denying that. How many opportunities you want to go after, is entirely up to you.