In the 2010-2011 season, the average length of an NBA game was 138.1 minutes, or roughly 2 hours and 20 minutes. NBA games consist of four 12-minute quarters with a 15-minute halftime. As with any sport, a number of factors both in and outside of the actual game can affect the game's real-time length.
An NBA game typically lasts around two hours when factoring in things like timeouts, commercial breaks and stoppages in play. If the score is tied after the four quarters have elapsed, five-minute overtime periods are played until one team has a greater number of points. The NBA does not allow for tie games.
Due to the high stakes of the NBA playoffs, games are often much longer in length than their regular season counterparts, sometimes by as much as half an hour.