The federal budget is a statement (actually a law) of what the U.S. Federal government is permitted to spend in a given year. Most of the Federal revenues are due to taxes. If the government spends more than it takes in the nation runs a deficit and must borrow money (from U.S. citizens and foreign investors) to pay the difference. Thus, the country builds up a debt and every year must pay the interest on that debt.
To start out, let's have a look at what the official budget pages actually look like. A good place to start is the White House Office of Management and Budget (OMB) web site, which gives detailed information about the Federal budget including the FY2004 Request, FY2003 Request and Congressional Action and previous budgets. One can spend many sleepless hours roaming these websites and studying the intricacies of the federal budget. Actually, it is much more complicated than it looks. The numbers are not always what they seem. There are "offsets" (or more accurately, "gimmicks") to mask deficits and make the budget look better than it is, but these are the official data.
In short, the federal budget process starts with the President (diagram of the budget process). In the fall (say Fall of 2002) each agency tells the OMB what it needs and why. Of course, the agencies will have been working on their budgets for several months and having discussions with the OMB. At this stage, the agencies are not talking with Congress about the budget. It is a time for private discussions, strictly within the Executive Branch. Around Thanksgiving, OMB sends the agency a "passback" with a target budget they are suggesting is appropriate for that agency. Then, what follows is a month or so of back-and-forth before the President makes the final decisions, usually in the Christmas-New Year timeframe. That gives some time for the President's staff to prepare the State of the Union address (where all the important budget and policy initiatives are announced by the President), as well as orchestrate "leaks" for PR value, and for OMB to put together the budget document that is due in Congress in early February.
At that point, Congress starts its process, usually with passage of "Budget Resolutions" in both houses that provide bottom-line numbers for various broad categories. These bills are non-binding on the appropriations process, but they provide guidance. The President's budget request is sent to the Appropriations Committee and immediately taken apart into 13 separate pieces, each send to one of 13 appropriations subcommittees. Each subcommittee will submit a bill covering its agencies. Thus, the full Senate and House will have to consider 13 separate appropriations bills and in the end, agree on them in every detail. For example, NSF's budget is under the jurisdiction of the "VA, HUD and Independent Agency" (usually referred to as "VA-HUD") Subcommittees of both the House and Senate. The subcommittees are given an "allocation" by the full committees, and then go to work to fit in all their agencies under that allocation. This is a time of intensive lobbying, with many members trying to get their favorite project (including "pork barrel" projects - i.e. not in the President's request) included in the bill.
In the end, both the Senate and House must pass all 13 appropriations bills (the same bills in every detail). They are sent to the President, who has 10 days to sign them, veto them, or just let them sit (pocket veto). For those that are vetoed, the Congress has to make changes the President will accept. If the beginning of the new fiscal year arrives without a signed bill (for a particular set of agencies), then the Congress must pass (and the President sign) a "Continuing Resolution", which specifies spending limits and a sunset provision for the bill. It is not unusual, especially in recent years, for several continuing resolutions to be required before a final appropriation bill is passed and signed.
If, for any one of the 13 appropriations bills, neither an appropriation bill is passed by both Houses of Congress and signed by the President, nor a Continuing Resolution is passed, then all those agencies covered by that bill must shut down. While there is some flexibility to continue "essential services", most of that part of government comes to a halt. This happened in the winter of 1995-96 as a result of a standoff between the Speaker of the House Newt Gringrich and President Bill Clinton.Several sites give summaries of the budget process. See, for example a Congressional Research Service (CRS is part of the Library of Congress) site and a paper by Robert Keith. A White House description of the process (using Pres. Clinton's last budget, FY2001 as an example) is also available.
The White House OMB
FY 2003 Request and Congressional Action
Stanford Diagram of the Federal Budget Process
Congressional Research Service
White House Description of the Budget Process