People who are charged with felony offenses, and many individuals who are charged with misdemeanors, may be eligible for appointed counsel or for assistance through a public defender's office. When a defendant petitions for a court-appointed lawyer, the trial judge will typically make an assessment of the defendant's resources to determine if the defendant will qualify for an appointment of a criminal defense lawyer. When an appointment is made, although the defendant may be ordered to repay certain attorney fees following a guilty plea or conviction, there will not ordinarily be any fee in the event of acquittal or dismissal of the charges.
Some people assume that a court appointed criminal defense lawyer will offer services which are inferior to a privately retained lawyer. While it is certainly true that some public defenders, some appointed lawyers, and some private attorneys will prove to be insufficiently skilled or dedicated to their work to provide an effective defense, it is generally asserted that the average public defender will provide better representation than the average private criminal defense lawyer. The primary reasons for this include experience, as a professional public defender will typically have much more experience with criminal cases than a private lawyer, the ability to collaborate with other experienced lawyers within the office, and also due to the resources and systems available to a typical public defender's office. Many private criminal defense lawyers take appointments - meaning that if you are charged in a jurisdiction that appoints private lawyers to represent criminal defendants, many of the lawyers you might otherwise retain will be among those to whom a court might assign your case. And even if you are ordered to repay legal fees, the cost of an appointed lawyer is almost always significantly lower than the cost of a retained lawyer.
In short, if you can hire an effective criminal defense lawyer you should not hesitate to do so. But, if your means are limited, you should also not hesitate to request an appointed defense lawyer, and should not fear that you will receive inferior representation just because your lawyer was appointed.