The matching funds are free money, so it is a very good idea to take that money off the table. Look at it as free 100% return: you deposit $1000, your employer matches that $1000, you now have $2000 in your 401(k). (Obviously, I'm keeping things simple. Vesting schedules mean that the employer match isn't yours to keep immediately, but rather after some time; usually in chunks.)
Beyond the employer match, you need to consider what is available for investment in a 401(k). Typically, your options are more limited then in an IRA. The cost of the 401(k) should be considered, as it isn't trivial for most. (The specifics will of course vary, but in large IRA accounts are cheaper.)
So, it's about the opportunity costs. Up to the employer match, it doesn't matter as much that your investment choices are more limited in a 401(k), because you're getting 100% return just on the matching funds. Once that is exhausted, you have more opportunity for returns, due to having more options available to you, by going with an account that provides more choices.
The overall principle here is that you have to look at the whole picture. This is similar to the notion that you should pay-down your high interest debt before investing, because from the perspective of investing the interest you're paying represent a loss, or negative return on investment, since money is going out of your accounts. Specific to your question, you have to consider the various types of investment vehicles available to you. It is not just about 401(k) and IRA accounts. You may also consider a straight brokerage account, a savings account, CDs, etc. The costs and returns that you can typically expect are your guides through the available choices.