Option selling call selling and put selling

#1

Does option writer has to hold the trade till expiry?

#2

Not necessary, you can square off (buy back) on same day itself or any other day prior to expiry