Lying under oath is called perjury, and it can be a felony-level offense. It is not necessary to be in a court room giving testimony to commit perjury: lying on one's taxes or other legal documents can also be a criminal offense.
In federal cases, committing perjury can be a felony, particularly if false statements interfere with a high-stakes criminal case, such as a murder. In federal cases, perjury involves making false statements under oath to a federal proceeding, federal court, or federal grand jury. Soliciting or influencing another person to make false statements under oath to a similar body. It is the burden of the court to prove that the statements in question were made willfully and intentionally, not by mistake or out of confusion.
In addition, certifying legal documents that are known to contain falsehoods or forgeries may be a felony for sworn officials like notaries or town or county clerks.
In many states signing your name to a document that you know is false or making untruthful statements is likely a misdemeanor unless there are significant consequences involved. Most cases of perjury at the state level involve witnesses to a crime who make false statements to protect themselves or a friend from prosecution, such as testifying that a drunk friend was not driving prior to a car accident.
A former F.B.I. bureau chief was convicted of obstruction of justice and several counts of perjury for lying under oath in court about his efforts to remove a well-known Boston gangster, Whitey Bulger, from F.B.I. protection as an informant. The man reportedly also made false statements in a book he authored about his career but was sentenced only to probation for the false statements, due in part to his age and health status. Bulger was a mobster who was protected from prosecution by the F.B.I. while orchestrating the murder of his rivals.
Pennsylvania's Attorney General was convicted of felony perjury and sentenced to 10-23 months in prison after she leaked information to a newspaper then lied in court about it. Kathleen Kane had a tumultuous four year term as an upstart Attorney General with no previous political experience, forcing state supreme court justices to resign and prosecuting state officials. Her Achilles heel turned out to be leaking grand jury information about a rival to a newspaper, then lying about it in court.
Former Secretary of state and Democratic party presidential candidate Hillary Clinton was accused of perjury for telling a congressional committee that she did not receive classified government emails through a private email server set up in her home. The committee was told by F.B.I. Director James Comey that Clinton's email only contained a handful of classified documents among thousands and that it would be easy to overlook a "C" in the documents that designated its secret status. The F.B.I. declined to pursue charges against Clinton but in the days before the presidential election Comey said publicly that his agency would reopen an investigation into her emails after finding thousands on another person's computer. Democrats believe the information about an investigation ruined Clinton's chances of winning the election.