Presidential elections have been closer in the past few decades than they were for most of American history. Here's a list of all the U.S. presidential elections that were decided by less than 1% of the vote:
Funny, huh? Other close ones were 1844 (decided by 1.5% of the vote), 1876 (3%), 1916 (3%), 1976 (2%), 2004 (2.5%).
Four straight close elections in the 1870s-80s, five close elections since 1960, and almost none at any other time.
At the congressional level, however, NY-20 notwithstanding, close elections are less and less likely to be close. Here's a graph showing, for each decade of the past century, the proportion of elections each to the House and Senate that were closer than 51.0%-49.9% of the two-party vote:
Close elections (in percentage terms) have always been more common in the Senate than the House. (We can't take the comparison back before the 1910s, because it was during that decade that direct election for senators was implemented.) In addition, the rate of close elections in the House has declined steadily over the century. If you count closeness in terms of absolute votes rather than percentages, then close elections become even rarer, due to the increasing population. In the first few decades of the twentieth century, there were typically over thirty House seats each election year that were decided by less than 1000 votes; in recent decades it's only been about five in each election year.
The decline of House elections each year is no surprise; as Nate and I discuss, the increasing incumbency advantage has reduced the number of close elections; beyond this, localities are more politically homogeneous than they used to be, and with the nationalization of political parties, it is harder for candidates to tack to the center in individual district races. For the Senate, these factors are present, but to a lesser extent. Gerrymandering sounds like a potential explanation--after all, House districts get redrawn and Senate districts don't--but there's actually no evidence that redistricting reduces competitiveness of legislative districts on the average. (I'll refer you to Ansolabehere and Snyder's 2002 paper for more discussion of these issues.)
P.S. We got our data from various sources, including some old data files that I can't remember who prepared, also from CQ, see for example here.