American-style options (most equity options) can be exercised any time before expiration. European-style (most index options like SPX) can only be exercised at expiration. ITM options that aren't closed by expiration are auto-exercised at most brokers. The unintended consequence: a trader who forgets to close a winning long call on Friday can end up long 100 shares on Monday — with the entire stock-purchase price now at risk.
Early assignment on short options is rare but possible. Two situations to watch: deep-ITM short calls right before a dividend ex-date (the dividend captures often trigger early exercise) and deep-ITM short puts in volatile stocks (rare, but happens). The defensive habit: close any short option that goes deeply ITM before assignment risk becomes material, even if the trade still has theoretical extrinsic value.