The option buyer or holder may exercise his option at any time. Exercising a standard call will result in purchasing 100 shares of the underlying stock for the strike price. Exercising a standard put will result in selling 100 shares of the underlying stock for the strike price. In either case, it will also result in the option seller being assigned.
If an option holder exercises his option, which can happen at any time, the seller will be assigned. Being assigned on a standard call will result in selling 100 shares of the underlying stock for the strike price. Being assigned on a standard put will result in buying 100 shares of the underlying stock for the strike price. The only time you will be assigned is if the buyer decides to exercise.
At expiration, your broker should have a system in place that will make sure you do not lose money due to an oversight. If you hold an option that can be exercised for any amount of money, they will automatically take that action at the close of trading on expiration day. This means that on the flip side, if you sold an option that is worth any money, you will be automatically assigned if you hold that position at expiration. Usually it is more profitable to close out all positions just before assignment or exercise at expiration, but in some cases it the options price indicates it will be better to let the automatic action happen.