There is no limit on how much you can earn. There is a limit on how many hours you can work, though. Student visas require that you have given proof of sufficient means prior to coming to Germany, generally via a blocked account. As a foreign student in Germany, you are typically allowed to work up to 120 full days per calendar year (or 240 part-time days). See also the r/germany wiki on working as a student.
Of course, that work is then subject to German rules. There is the "working student" privilege that exempts the employer from social security contributions if you're primarily a student, i.e. work at most 20 hours per week during lecture periods. Income will be taxed normally, which means that "minijobs" have simplified deduction rules that make them effectively tax-free for you. Regardless of how you earn income, the first ~10k have a 0% tax rate.
And you can also make money from capital gains (e.g. sales, dividends, and holding accumulating funds). The tax is not going to be the problem here (only the profit is taxed. First ~1k per year are tax-free. Beyond that, taxed with a flat rate of 25%, or optionally with your income tax rate, which is likely to be better). Rather, the problem is going to be filing the taxes correctly. Potential complicating factors:
- holding assets with a non-German broker (German brokers will generate a suitable summary of your capital gains for you)
- holding non-EU funds (EU funds (e.g. using the UCITS legal structure) have drastically simplified taxation)
- declaring losses
- trading non-stock assets such as crypto (different tax rules)
- having US residency or citizenship (most banks don't want to work with you)
- double taxation issues