A lawyer in the United States is technically called an attorney at law or an attorney-at-law. In some states a lawyer is called an attorney and counsellor at law (or attorney and counselor at law).
Broadly speaking, an "attorney" is one who acts on behalf of another person in some capacity. For example, an "attorney-in-fact" is a kind of agent who acts on behalf of another person, typically with respect to business, property, or personal matters, and who generally does not have to have a particular license from the government. "Power of attorney" refers to the power of such an attorney-in-fact to act in the name of another person (and sometimes to the paper document that is used to convey this power).
By contrast an attorney-at-law is a lawyer -- a person trained and licensed to practice law -- to represent clients in legal matters (both in and out of court) and to give legal advice. In the United States, the term "attorney" as used in every day speech usually refers to a lawyer. "Attorney General" is a public position, with responsibilities regarding legal research and legal action on behalf of the state, often on behalf of large groups of consumers (such as all the citizens affected by a fraud), usually held by a lawyer.
In common-law jurisdictions outside the United States, e.g., England, Canada, Australia, “attorney” is incorrect as a general term, and "lawyer" is used instead. However, in these areas, the specific terms “crown attorney”, “power of attorney”, and “Attorney General” are used.
In earlier times, some states, as well as the U.S. Supreme Court, maintained a divided legal profession, as can still be found in the United Kingdom, consisting of attorneys (solicitors) and counsellors (barristers). In deference to this practice, when an Attorney-at-Law is admitted to practice in some states, his or her certificate of admission bears the title Attorney and Counsellor-at-Law in recognition of his inheritance of both of these roles.
Some attorneys use the post-nominal "Esq.", as the abbreviated form of the word Esquire.