A lawyer is "one whose profession is to conduct lawsuits for clients or to advise as to legal rights and obligations in other matters." To practice as a lawyer in the U.S., one must obtain a license by passing one's state bar examination.
An attorney is "one who is legally appointed to transact business on another's behalf." Simply put, you can work as an attorney to manage things apart from legal cases. You might be given power of attorney, for example, to manage the accounts of a loved one who is unable to do so themselves, even if you have no background in law. In a court of law, the attorney is usually a lawyer.