The deficit is the difference between what the U.S. Government takes in from taxes and other revenues, called receipts, and the amount of money it spends, called outlays. The items included in the deficit are considered either on-budget or off-budget.
You can think of the total debt as accumulated deficits plus accumulated off-budget surpluses. The on-budget deficits require the U.S. Treasury to borrow money to raise cash needed to keep the government operating. It borrows the money by selling securities to the public.
The Treasury securities issued to the public and to the Government Trust Funds then become part of the total debt.
SOURCE: Treasury Department