An activity is presumed to be engaged in for profit and not to be a hobby, if it is profitable in three out of five consecutive years. For a new business, this means that you don't have to show a profit for your first two years. (A narrow exception to this rule applies to horse breeding, training, showing, and racing; for these activities, a presumption of a for-profit activity arises if income exceeds deductions in two out of seven consecutive years.)
If your business qualifies for this presumption, it means that the IRS (not you) would have the burden of proving that your business is a hobby, if the issue comes up in an audit. If you don't qualify for the presumption, you may still be able to show that you operated for profit under the IRS's nine-step profit motive test.
The IRS does provide a form (Form 5213, Election to Postpone Determination as to Whether the Presumption Applies that an Activity Is Engaged in for Profit), on which you can officially elect to have the IRS wait until the first five years are up before examining the profitability of your business. If you use this form, it should be filed within three years of the due date of the return for your first year in business.
However, it's generally not necessary to file the form in order to take advantage of the presumption. If you haven't filed the form and you are audited by the IRS, you can file the form within 60 days of receiving the IRS notice, as long as your three-year period has not expired.