Yes, you can invest in the stock market with a study permit in the US, as long as it doesn't violate the terms of your visa. Passive income like stock market gains is generally allowed, but actively trading for income or starting a business may have restrictions. Always check your visa...