Think of an affidavit as written testimony. In court, you raise your right hand and swear that the testimony you are about to give is the truth, the whole truth and nothing but the truth. In an affidavit, you swear under penalty of perjury that the facts you set out in the document are true to the best of your knowledge. Lying in an affidavit is the same as lying in court testimony, and it constitutes a crime called perjury.
TL;DR (Too Long; Didn't Read)
Penalties for perjury vary between jurisdiction. Perjury is a felony, and punishment can include jail time, up to five years, and heavy fines.
Under Penalty of Perjury
Perjury started out as a crime for testifying falsely about material matters in court. As society became more complex, the term was expanded to apply to lying or failing to tell the whole truth in any sworn testimony, whether in court, hearings or written documents called affidavits. Under federal law, it has been held to apply to grand juries, bail hearings, Congressional committee hearings and depositions in civil lawsuits. Also included are sworn statements made in financial affidavits (such as loan applications), statements signed in bankruptcy filings or statements made to governmental agencies such as the Social Security Administration.
In court, a witness swears to tell the truth, the whole truth and nothing but the truth. Similarly, those who sign affidavits have to swear under penalty of perjury that the contents of their affidavit is true to the best of their knowledge. Like lying in court, lying about a material matter in a sworn affidavit is perjury, which is a crime.
Penalties for Perjury
Perjury is a crime under federal law as well as state law. Penalties differ among the jurisdictions.
When a person is convicted of committing perjury under federal law, that individual can be sentenced to up to five years in prison. Alternatively or concurrently, he may be sentenced to pay fines.
State Laws on Perjury
Each state enacts its own laws punishing perjury, but in all states, it is a felony and carries a possible prison sentence. A convicted perjurer can also be ordered to pay fines or be put on probation. The more the perjury interfered with a court or other official proceeding, the greater the penalty is likely to be. In California, a perjury conviction can result in two, three or four years in prison, depending on the circumstances or the consequences of the perjury, as well as the person's past record. In Texas, a felony conviction of perjury can put you in state prison for a period of two to 10 years plus a fine of up to $10,000.
If a person lies under oath at a criminal proceeding brought against him, the judge can increase the sentence for the underlying conviction. The grounds for this is that a criminal who lies under oath is not likely to be rehabilitated quickly. A person who lies under oath at another person's criminal trial can also be charged as an accessory to the crime.