When opting in, the user gives his prior consent, voluntarily and plainly allowing his data to be used.
In the case of opt-out, prior consent is not explicitly asked for and is considered to be given by default unless the user actively states otherwise. His data is used and the user’s only option is to unsubscribe after the fact.
The use of opt-in and opt-out is sometimes regulated by law.