The Sixth Amendment to the United States Constitution guarantees the right to effective assistance of counsel to every person charged with a crime that carries possible jail or prison time.
When you are charged with a crime and cannot afford an attorney, the Court will appoint counsel to represent you at no charge (or in some states, for a modest administrative fee.) Most often, this will be the public defender. However, if the public defender's office has a conflict, such as in multi-defendant cases where it represents another defendant, or in jurisdictions without a public defender's office, the court will appoint private counsel to represent you.
In addition to paying your lawyer's legal fee (usually at a reduced rate) the court will also pay for necessary expenses. Upon the application of your attorney, the court may approve payment for the services of a private investigator, forensic experts to test or retest evidence, expert witnesses and even discovery duplication expenses. In the event your attorney deems a transcript of a particular pre-trial hearing in your case necessary for trial, he or she can also request the Court to approve payment to the the court reporter, so that your lawyer can obtain it at no cost to you or your lawyer.
If you have been convicted and are appealing your conviction, once you have been declared indigent and counsel has been appointed for you in the appeal, the court will approve payment for transcripts of your trial and any pre-trial proceedings requested by your attorney. Similarly, if you have been appointed counsel to litigate post-conviction motions such as a motion for a new trial or motion for reduction of sentence, the court will approve requests for transcripts made by your court-appointed attorney.