This is one of the things Martha Stewart was convicted of. 18 USC 1001 is the US federal law requiring truthfulness. That statute forbids you to falsify, conceal, or cover up a material fact. One limitation on how broad this law is, is that it has to be a matter "within the jurisdiction of the executive, legislative, or judicial branch of the Government of the United States". If your neighbor is an FBI agent and he asks if you're the one who broke his window, and you lie, that's not a federal matter. Another limitation is that the lying has to be material.
The essential part of the law is subsection (a). Subsection (b) then
states an exception:
(b) Subsection (a) does not apply to a party to a judicial proceeding,
or that party’s counsel, for statements, representations, writings or
documents submitted by such party or counsel to a judge or magistrate
in that proceeding.
Then you also owe a lesser duty of truthfulness to the legislature.
Taking note of US. v. Yermian, it is not required that the person you lie to be a federal officer. Yermian lied to his employer, who was a defense contractor, and the fact that the relevant form was submitted to the government for scrutiny is what made it a matter in federal jurisdiction. Comparing the wording of 1001 to the perjury statute, the operative expression for perjury involves statements "which he does not believe to be true", we can see that the perjury statute requires telling the literal truth (see Bronston v. US), which allows so-called lies of omission (of a particular subtype: much more could be said about that). In contrast the lying statute forbids both literally false statements and concealing of the truth.
I don't have cases at my fingertips that indicate how broad your truthful answers have to be, for example if you think the FBI is trying to put away a friend and ask you about what he did on June 14, and you know that he did a bad thing on June 13, would it be lying in the relevant sense to conceal that fact which they didn't ask about.
A session of perusing cases has led to a tiny bit of further information. A literal reading of the statute says that you are in violation of the law if you falsify a fact (sloppy epistemology, unless it refers just to altering records and evidence), or conceal a fact, and the courts recognise this as a fundamental division. As for falsifying, the way that has been applied is to refer to cases where the accused makes a statement which asserts something that he knows to be untrue. Thus, saying "No" to a question when the truth is "Yes" is a violation.
A propos concealment, in US v. Diogo 320 F.2d 898 the court states that
False representations, like common law perjury, require proof of
actual falsity; concealment requires proof of wilful nondisclosure by
means of a 'trick, scheme or device.'
This case is pre-Bronston so there is mixing of concepts from perjury law and lying law, which would not happen now, but we can steering clear of their perjury citations. The crucial fact is that accused(s) were technically married in New York, for immigration purposes, and they were accused of a 1001 violation for having indicated that they were married. Part of the government's case was that such a marriage is not valid, and the court rejected that conclusion. The government's second prong was to maintain that the court "should affirm appellant's convictions on a theory of concealment", and this too the court rejected, saying "proof of their ulterior motives in marriage would not be tantamount to proof of willful and knowing concealment of these material facts". What they said on the forms was literally true, and they did not have a duty to volunteer information that they probably knew the government was interested in.
Contrarily in a later case, US v. Zalman 870 F.2d 1047 we are told that
the underlying purpose of a marriage is a material fact which bears
upon the validity of the marriage, and that any false or fraudulent
misrepresentation regarding the actual purpose of a marriage in order
to gain status as a resident of the United States can be punished
under 18 U.S.C.A. § 1001
so you have to be more truthful than the literal truth standard.
There are also circumstances where there is an independent duty to give information, such as reporting income to the IRS. In US v. Hernando Ospina 798 F.2d 1570 the court maintained
It is clear that in order to support a section 1001 concealment
conviction there must be a legal duty to disclose the facts the
defendant was convicted of concealing
citing US v. Tobon-Builes 706 F.2d 1092, where again there was a legal duty to report "existence, origin, and transfer of approximately $185,200 in cash".
In other words, it is not clear what information you are allowed to not volunteer when asked a question in a federal matter.