If you commit perjury you can face up to 1 year in jail plus fines or if the crime you lied about was serious enough you could face up to 5 years in federal prison for committing perjury or lying under oath.
When you go to court to testify or defend yourself you will swear under oath to tell the truth, the whole truth and nothing but the truth.
If you lie under oath that is known as perjury and you can face up to a year in jail or longer if convicted.
So always make sure you tell the truth and do not lie about anything.
Eventually the court will see through your lies and then you can be sent off to jail the same day until convicted.
Always tell the whole truth and nothing but the truth in court.