The answer depends on the jurisdiction, the court, and how the public defender system is set up. This answer addresses state court indigent defense at the trial level.
In many jurisdictions, state courts are organized by counties. In many of these counties, particularly larger and urban counties, public defenders are a department of county government (like the district attorneys who prosecute, or public works, or the tax assessor). These defenders are county employees, and paid a wage. They are not compensated "by the case."
In other jurisdictions, there may be no county-level public defenders. Courts there will appoint private attorneys to defend indigent defendants, and will compensate the defenders pursuant to a fee schedule promulgated by the court, or the judge's whim. The fee schedule may be time-based or flat fee, and usually provides differentials for type of case, amount of time required, investigative and witness fees, and often allows the lawyer to seek additional compensation if the lawyer thinks it's warranted. The court may decline the lawyer's motion, of course, at the risk that the lawyer won't take future appointments, a serious difficulty for the court which must, under the law, provide counsel for indigent defendants who face incarceration.
More than this, it's tough to generalize. The setup in Los Angeles County, California, for instance, will be different than the experience in Alliance, NE, or a small county in another state.
The same challenges face the federal courts. I'm only familiar with the California federal courts at the trial level, where a parallel system applies, with defenders on salary and employed by the federal government.
While some states provide representation on appeal using defenders employed by the state government, other states rely on individual lawyers being appointed, rather like the trial-level system.
Source: I'm a prior county public defender and private attorney in California.