The truth is that it varies, in part depending on how busy the airport will be and how much you need to do before you can go to the gate.
During peak travel seasons, airports are much more crowded, security lines are longer, and you’ll need to allow more time. The same goes for particularly busy times of day, such as Monday mornings (when business travelers are starting their work week). And, if you’re checking a bag, that requires more time than simply walking directly to security with a carry-on.
As a general rule, however, if you’re not sure whether it’s a busy time of year or day, most airlines suggest getting to the airport roughly two hours ahead of domestic flights. During busy travel periods, arriving three hours in advance of your flight isn’t a bad idea.
If you’re traveling when you know the airport will be less busy, it’s likely you can safely get to the airport with less of a time cushion—but keep in mind that each airline has a cut-off time by which either checked bags must be dropped off or passengers must be checked in (or both). Your arrival time, therefore, should be based on that cut-off time rather than the time your flight is scheduled to depart.