1. He is wearing wrinkle-free trousers.

2. He is wearing wrinklefree trousers.
------------------------
Are both okay? Do we have to use the hyphen?

You should use the hyphen, yes.

http://grammar.ccc.commnet.edu/grammar/compounds.htm

Both sentences are grammatically correct, but the usage of the hyphen depends on the context and style guide you are following.

In general, the hyphen is used to combine two or more words into a single adjective that describes a noun. In this case, "wrinkle-free" is a compound adjective describing the trousers. You can use a hyphen to clarify that "wrinkle" and "free" should be interpreted together as a single idea.

Sentence 1 uses a hyphen, "wrinkle-free," which is the more common choice. It emphasizes that "wrinkle" and "free" should be understood together as a single concept modifying "trousers."

Sentence 2 does not include a hyphen, "wrinklefree," which is less common and can potentially be confusing. It may be necessary to pause and reread the sentence to understand that "wrinkle" and "free" should be combined into a compound adjective.

To ensure clarity and consistency, it is generally recommended to use a hyphen when combining words into compound adjectives, such as "wrinkle-free trousers." However, different style guides (such as AP Style or Chicago Manual of Style) may have specific rules or preferences about hyphen usage, so it's worth checking the guidelines for the context in which you are writing.