So, you know about how long you want to have your money invested. That's a good start. Now, I will breakdown the actual ways that you will implement this. There are many different asset classes out there and many different options to implement them, so don't assume that this is the only way to invest your money. It is, however, a plausible method and a start for many people. As you are sure, be sure to read relevant prospectuses before investing and understand the risks (if you have stocks, bonds or real estate they often can and will go down!). As has been mentioned elsewhere, there is not much reward without risk. If you are able to manage your emotions and, especially, expectations, investing will be a great way to help solve a lot of your financial goals.
Timeframe: 7 years+
Stocks are generally considered the riskiest form of asset class used for ordinary investors (derivates, options in particular, are considered riskier but I would not recommend for the majority of investing needs). They are, also, the best performing overall asset class. Over the last 30 years, the S&P 500 has returned 7.13% annually after inflation. Even in the past 16 years (February 2000 - February 2016), the S&P 500 has been able to return 1.8% after inflation. This is amazing: it has survived two phenomenal crashes and is still up during that time frame. Understanding the wild swings of stocks, however is important to keep a sane head. Take a look at the following chart of Facebook since its IPO:
As you can see, it is a fantastic return, up ~183% in less than 4 years. Consider the following stock instead, though:
This stock was down 39% in only six months! If you can't handle that kind of decrease, then you probably should either stop checking your account or have fewer stocks. That stock, by the way, is Facebook's first six months. You can see it on the chart above. For getting into American stocks, I recommend VTSAX and for international stocks I recommend VFWAX. These will give broad exposure to stocks and will diversify yourself away from individual stocks.
Timeline: 3-7 years
Bonds are a traditional alternative to stocks, providing the ability to invest in individual companies (or governments) without owning an actual part of the company. Because they are forced to be paid back and there is priority on liquidation (meaning if the company goes belly-up bondholders are paid before shareholders), bonds are generally lower risk. There are, however, very risky bonds/debt: think of Greek bonds in 2012 or mortgage bonds in 2008. The lowest risk bonds are generally short-term government bonds or the largest, most creditworthy companies such as Exxon-Mobil or Microsoft. As the term becomes longer, there is more risk as well as more potential for return. Bonds should be part of the appetite for any balanced portfolio. The rule of thumb I have heard for a retirement portfolio is (Age - 10)% in bonds. That may not hold true to everybody's risk portfolio, but it has worked for me so far.
Timeline: 5+ years
Anybody who has a passing recollection of the 2008-2009 Great Recession can tell you that it was related to real estate. Real estate nationwide cratered and investors fled for the hills. What many have not noticed since, however, (outside of some areas in the country) is the slow thawing and recovery that has happened since then. Even in dour times, there are opportunities to earn money investing in companies that get a lot of rent. Real estate is often thought of as a "sector" play: if oil goes up or down, if the NASDAQ crashes, a well diversified real estate portfolio (meaning it is not in one specific location) can be relatively protected. Obviously (as we learned eight years ago), this is not a foolproof plan, but real estate still offers an option in a well-diversified portfolio.
Timeline: <5 years
Cash is the safest investment possible, but it is not without risks. If you hold your dollars in your mattress or in a safe, inflation will eat away at its purchasing value. If you held $50,000 in cash in 1990 planning on spending for college tuition with it in 2010, you will understand the pains in this method. There are low-return, low-risk options for cashholders though, such as CDs and money markets. CDs and savings accounts are FDIC insured up to a total of $250,000. Money markets are technically not FDIC insured but it is very rare that they will decrease in value, occurring only during the Great Recession. Interest rates are currently very low, but have shown signs of thawing.
These four options will generally provide most of the meat of a diversified portfolio. The longer your timeframe, remember, the more you are able to have stocks (as opposed to cash) where saving for something in the near-term will have the opposite advice. Of course, if you want to tell somebody your risk profile and have them do it all for you, it's also a good option.