On a 4-5 day cruise there will be 1 night designated formal.... where a suit and tie is recommended dress for men. On 7 night cruises there will be 2 formal nights. The remaining nights are casual.. where slacks and shirts will do.
Running out to buy gowns and tuxes isn't necessary, but most everyone has a nice dressy outfit, and a suit for the men.
Personally I believe "dressing up" a bit for a night or two makes the cruise experience just a little bit special.