If you meet the eligibility requirements for both types of bankruptcy, then you can choose the type of bankruptcy that makes the most sense for your situation. However, you may not have a choice.
Under the new bankruptcy law, filers whose incomes are higher than the median income for a family of their size in their state may not be allowed to file for Chapter 7 bankruptcy if their disposable income, after subtracting certain allowed expenses and required debt payments, would allow them to pay back some portion of the unsecured debt over a five-year repayment period. (For more on this and other Chapter 7 eligibility requirements, see Chapter 7 Bankruptcy -- Who Can File?)
Also, if you have secured debts of more than $1,149,525 and unsecured debts of more than $383,175, for example, then you cannot use Chapter 13 bankruptcy. (For more on this and other Chapter 13 eligibility requirements, see Are You Eligible for Chapter 13 Bankruptcy?)
Most people who file for bankruptcy choose to use Chapter 7, if they meet the eligibility requirements; Chapter 7 is a popular choice because, unlike Chapter 13, it doesn't require filers to pay back any portion of their debts. For more reasons why you might want to file for Chapter 7, see When Chapter 7 Bankruptcy Is Better Than Chapter 13 Bankruptcy.
However, Chapter 13 might be a better choice, depending on your situation. For example, if you are behind on your mortgage and want to keep your house, you can include your missed payments in your Chapter 13 plan and repay them over time. In Chapter 7, you would have to make up the whole past due amount right away -- and you might lose your house, if your equity exceeds the exemption amount available to you. For more on situations when Chapter 13 makes sense, see Reasons to Use Chapter 13 Bankruptcy Instead of Chapter 7 Bankruptcy.