If you lied to the police about a crime your friend committed, you could face significant consequences. As a general rule, you aren't under any obligation to speak with the police. However, if you choose to talk to investigators, it's never a good idea to lie. By lying to the police, you could be charged with one or more crimes of your own.
In many jurisdictions, it's a crime to make false or misleading statements to the police or public officials. This crime is generally called making false statements.
For example, assume that you had a friend who is charged with a DUI. You and your friend had been out drinking the night he was arrested, and when the police learn this, they come to ask you questions. You tell the police that you only saw your friend have one or two drinks, even though you actually saw him have many more. You could be charged with making a false statement.
Lying to the police about a friend's crime can also lead to charges of obstruction of justice, also known as obstructing a law-enforcement officer. People commit obstruction of justice when they do anything to hinder, delay, or obstruct law enforcement officials in the performance of their official duties. This includes acts such as destroying evidence or communicating false or deceptive information.
In the above example, assume that the police come to your home to ask you questions about the night your friend was arrested for DUI. They ask to speak to you by name, but instead of admitting who you are, you give them a false name. You could be charged with obstruction of justice.
You might also face a charge of being an accessory after the fact if you lied to the police about your friend's crime. To be charged with this crime, you have to assist someone after that person commits a crime with the intent to help that person avoid arrest, prosecution, or punishment.
Let's say, for example, that your friend comes to your house after driving drunk and then running from the police. Soon after he arrives, the police show up. They ask you if you've seen your friend, and you tell them that you don't know where he is. Because you lied to the police knowing that it would help your friend avoid arrest, you can be charged with being an accessory after the fact.
Perjury involves making false statements while under oath or affirmation. For example, if you give testimony at trial, you must swear or affirm that your testimony will be truthful. If you lie about something material while giving such testimony, you can be charged with perjury. When dealing with the police in a criminal investigation you typically aren't under oath, so you cannot commit perjury by lying to them (but you have likely committed another crime).
If you have lied to, misled, or otherwise interfered with the authorities, or have been charged with a crime relating to such conduct, you need to speak to a criminal defense attorney right away. An experienced attorney in your area will be able to tell you what crimes you could be charged with and what you can do to help yourself. If the police accuse you of lying, you should usually ask to speak to an attorney before making any statements that might incriminate you.