Assuming that I can afford it: should I try to max contribute ($5k) to my Roth IRA as soon as possible in the tax year or break up the contributions evenly throughout the year?
That depends whether you're betting on the market going up, or down, during the year.
If you don't like to bet (and I don't), you can take advantage of dollar cost averaging by splitting it up into smaller contributions throughout the year.
From a purely analytical standpoint, assuming you are investing your Roth IRA contributions in broad market securities (such as the SPDR S&P 500 ETF, which tracks the S&P 500), the broader market has historically had more upward movement than downward, and therefore a dollar invested today will have a greater expected value than a dollar invested tomorrow. So from this perspective, it is better to "max out" your Roth on the first day of the contribution year and immediately invest in broad market (or at least well diversified) securities.
That being said, opportunity costs must also be taken into account--every dollar you use to fund your Roth IRA is a dollar that is no longer available to be invested elsewhere (hence, a lost opportunity). With this in mind, if you are currently eligible for a 401k in which your employer matches some portion of your contributions, it is generally advised that you contribute to the 401k up to the employer-match. For example, if your employer matches 75% of contributions up to 3.5% of your gross salary, then it is advisable that you first contribute this 3.5% to your 401k before even considering contributing to a Roth IRA. The reasoning behind this is two-fold: first, the employer-match can be considered as a guaranteed Return on Investment--so for example, for an employer that matches 75%, for every dollar you contribute you already have earned a 75% return up to the employer's limit. Secondly, 401k contributions have tax implications: not only is the money contributed to the 401k pre-tax (i.e., contributions are not taxed), it also reduces your taxable income, so the marginal tax benefit of these contributions must also be taken into account. Keep in mind that in the usual circumstances, 401k disbursements are taxable.
Finally, many financial advisors will also suggest establishing an "emergency fund", which is money that you will not use unless you suffer an emergency that has an impact on your normal income--loss of job, medical emergency, etc. These funds are often kept in highly liquid accounts (savings accounts, money-market funds, etc.) so they can be accessed immediately when you run into one of "life's little surprises". Generally, it is advised that an emergency fund between $500-$1000 is established ASAP, and over time the emergency fund should be increased until it has reached a value equivalent to the sum of 8 months' worth of expenses. If funding an IRA is preventing you from working towards such an emergency fund, then you may want to consider waiting on maxing out the IRA before you have that EF established.
Of course, it goes without saying that credit card balances with APRs other than 0.00% (or similar) should be paid off before an IRA is funded, since while you can only hope to match the market at best (between 10-15% a year) in your IRA investments, paying down credit card balances is an instant "return" of whatever the APR is, which usually tends to be between a 15-30% APR.
In a nutshell, assuming you are maxing out your 401k (if applicable), have an emergency fund established, are not carrying any high-APR credit card balances, and are able to do so, historical price movements in the markets suggest that funding your Roth IRA upfront and investing these funds immediately in a broadly diversified portfolio will yield a higher expected return than funding the account periodically throughout the year (using dollar cost averaging or similar strategies). If this is not the case, take some time to consider the opportunity costs you are incurring from not fully contributing to your 401k, carrying high credit card balances, or not having a sufficient emergency fund established.
This is not financial advice specific to any individual and your mileage may vary. Consider consulting a Certified Financial Planner, Certified Public Accountant, etc. before making any major financial decisions.
Dollar cost averaging is a method of regularly investing money as it is available. For example, $100 from each paycheck. It has been shown to bet better, on average, than collecting the money and investing it all at once. It is not intended to be used when you have the entire amount up front. See this link.
Dollar cost averaging a lump sum would only be beneficial if the market was just as likely to go up as is to go down. Since, over time, the market (historically) has always gone up, your best bet is to invest all of your money right away. Anything else is just trying to time the market.
This may be a lame answer, but the best IRA contribution strategy is the one that will actually stick to.
A single lump sum contribution every year may be a difficult thing for you to maintain. When it's time to make your contribution, you may say "eh, $5000 is a lot of money, and my checking account balance is kinda low, I'll wait before I contribute". You keep putting it off, and then you miss the opportunity for the year.
If you setup small regular automatic withdrawals, your IRA contribution will run on auto-pilot. Depending on your cash flow, this may not be favorable, though.