You need an ITIN as soon as you are ready to file your federal income tax return, since you need to attach the return to your application. To apply for an ITIN, complete Form W-7, the Application for IRS Individual Taxpayer Identification Number. See the related Instructions for Form W-7 for documents that will be needed and where the application is to be submitted. Refer to the website Individual Taxpayer Identification Number (ITIN) for specific information.
There are exceptions to the requirement to include a U.S. tax return with the Form W-7. For example, if you are a nonresident alien individual eligible to receive the benefit of reduced withholding under an income tax treaty, you can apply for an ITIN without having to attach a federal income tax return. For a complete list of exceptions to the requirement to attach an income tax return, refer to the Exceptions Tables in the Instructions for Form W-7.