The money that you invest in stocks needs to be money that you don't need immediately. This does not mean that it is not necessarily money that you won't need for 20-30 years. If you have money that you are confident that you will not need for decades, you should probably invest that money in your own home. Follow the old Benjamin Franklin saying "A penny saved is a penny earned."
If you currently pay 7% interest on your home loan, any extra money that you apply to your mortgage will immediately give you a 7% return for the balance of your mortgage time. Therefore if you pay a one-time extra $1,000 on a 7% mortgage that has 23 years left on it, then it will result in $5,002.04 that you didn't have to pay over the course of the 23 years. This is an absolutely guaranteed return - over the course of 23 years you will be over $5,000 wealthier due to that one-time investment.
Your home mortgage is the safest "buy and hold" investment that you can make! You already know that you pay a certain percentage. If you pay the loan off early, you effectively make that loan percentage as an investment return.
Also, the same logic goes for your car loan and definitely your credit cards. This is typically more short-term debt than your home. Quick payoff on any short-term debt will guarantee you the quickest and best investment strategy simply because you do not spend those pennies, you save them. Benjamin Franklin will be proud of your efforts to quickly and efficiently pay off your short-term and long-term debt.