Lawyers are people who have gone to law school and often may have taken and passed the bar exam.
An attorney is someone who is not only trained and educated in law, but also practices it in court. A basic definition of an attorney is someone who acts as a practitioner in a court of law.