When does a federal budget deficit occur?

When does a federal budget deficit occur?