Source: Flickr user Visha Angelova.

It's estimated that 1.86 million people will graduate from college in the class of 2015, and if you're one of them, congratulations! As you start your journey into the working world, retirement may seem like the distant future, but now is the best time to start thinking about it. Chances are good that your first job will offer a 401(k) or similar retirement plan, so here's what you need to know before you sign up.

What is a 401(k) anyway?
A 401(k) is a tax-advantaged investment plan designed to help you save for retirement, and it's considered one of your benefits of employment. Basically, you contribute money into the account from your salary and choose from a selection of investment funds to put your money into.

Contributions to a 401(k) account are made on a pre-tax basis, meaning that any money you decide to contribute to your account doesn't count toward your taxable income this year. And your investments can grow and compound on a tax-deferred basis -- meaning no matter how big your account grows, you won't pay a penny in taxes until you withdraw the money.

Many 401(k) plans also feature a "Roth" option. Basically, a Roth 401(k) works similarly to a traditional 401(k), except your contributions are taxable this year, but your withdrawals will be tax-free once you retire. So if your employer's plan has a Roth option, it's basically giving you the choice of when you want to pay your taxes -- now or later.

Many employers automatically enroll employees as soon as they're eligible, and most have a default percentage of your salary that will be contributed, unless you specifically tell them not to (3% seems to be common). However, if your company doesn't auto-enroll you, or if you want to contribute more than the minimum, it's important to contact your plan administrator to ensure you enroll as soon as possible.

The employer's match and how it works
Most 401(k) plans offer some type of employer matching program. It's generally a certain percentage of your contributions, up to a maximum amount of your salary.

For example, your employer may match 50% of what you choose to contribute, up to a maximum of 6% of your salary. What this means is that if you earn $50,000 and contribute 6% of your salary to your 401(k), or $3,000, your employer will contribute an additional $1,500.

Basically, you should think of the employer match as free money, or part of your salary. If at all possible, take full advantage of your employer's matching program. According to Catherine Golladay, vice president of 401(k) Participant Services at Schwab Retirement Plan Services, "this should be your number one financial priority, even before paying down debt."

Bear in mind that you may not be entitled to your employer's contributions until you've worked for the company for a certain amount of time. Once this time period passes, you are "vested," and the money in your account is all yours, even if you stop working for the employer. If this amount of time hasn't passed before you leave, you may not be entitled to your employer's matching contributions, though money that was taken out of your paycheck to contribute to the account will be yours.

How much should you contribute?
By all means, you should contribute enough to take full advantage of your employer's match, but this should be looked upon as the minimum amount you should be saving, and it may not be enough to get you through retirement.

The IRS allows elective contributions of up to $18,000 for 2015, and while I realize most new graduates can't reasonably afford to contribute nearly that much, the point is that you can save a lot more than your employer is likely to match.

And you may be surprised at how far a small additional contribution can go over the long run. For instance, let's say you're 25, you earn $50,000 per year, and your employer will match the first 4% of your salary dollar for dollar. If you contribute 4% of your salary in order to take full advantage of the match, your account could grow to $1.1 million by the time you reach 65, assuming annual raises of 2% and 7% average investment gains.

That sounds like a lot of money (and it is), but don't forget about inflation. $1.1 million today won't be worth $1.1 million 40 years from now.

However, if you increased your contributions slightly to 6% of your salary, you could end up with a $1.38 million nest egg. This could make a big difference in your quality of life in retirement.

How to invest your contributions
This is probably the question I'm asked most often in my daily life by friends and family: "Can you take a look at my 401(k) and see if I'm doing it right?" If you're confused about how to choose investment options in your 401(k), you're definitely not alone.

There is no magic formula for the proper allocation, and different plans have different investment funds to choose from, but there is a general rule: Stocks tend to perform better than bonds over the long term, but they can be quite volatile from year to year. Early in your career, you should allocate most of your portfolio to stocks. Over time, you can gradually mix in more bonds and other fixed-income investments to reduce the risk of your portfolio -- after all, when you're 60 years old, you have less time to recover from a stock market crash.

The stock/bond mix that is right for you depends on your particular situation (and who you ask), but my favorite rule of thumb is to take your age and subtract it from 110 to determine how stock-heavy your portfolio should be. So, if you're 25, an allocation of 85% stocks and 15% bonds is probably appropriate for you.

Start early and put in as much as you can comfortably afford
The most important takeaway here is that you need to get enrolled in your employer's 401(k) as soon as possible and contribute as much as you can reasonably afford to. Even a small increase in contributions can make a big difference over the long run, so choose some investment funds that match your risk tolerance, set your contributions to automatically come out of your paycheck, and let the magic of compound investment gains do the rest.