There are several countries that allow pre-clearance when entering the United States of America. These include, but are not limited to Canada and Ireland. What this means is that you go through immigration and customs rituals in those countries even before you arrive in the United States.
As a result, it is necessary to arrive at the airport well in advance of your flight's departure. I recommend at least 2.5 hours. This will give you enough time to check-in and go through the formalities. Usually most of the flights to the United States leave at the same time so there is usually long lines.
If your flight is delayed, you should still arrive at the airport the recommended 2.5 hours or better since your flight may leave earlier than the delayed time or the Immigration and Customs facilities may be closed when you get there. In which case, you have to wait for the next day in order to depart at your own expense.