Usually the answer is the same as for any holiday.
On a cruise ship the general atmosphere and life on board depends on the specific of the itinerary. If you cruise happens on a hot weather and exotic itinerary, passengers are of a younger age and will tend to focus more on the outside decks around the swimming pools and jacuzzis, or on the shore beaches. If the cruise happens to be in a more cultural itinerary and colder weather, the average age of the on board population will be of an older age with tendecy to a more casual atmosphere.
However there is a general rule that the informal dress code is recommended or in some cases mandatory for dinners at the "a la carte" restaurants.
If you want to avoid this rule you can just dine to a buffet restaurant (with self service).
Usually the nights on board cruise ships are a bit more special as the tourists will return from shore, restaurants start to open, later the theathre, live bands start to gather in lounges so most of the passengers will act like they would go out in the evening, dressing themselves more casual or formal.
It worth mentioning that on every cruise there are at least one or two gala nights where the recommended dress code is formal (business, black or white tie). Usually guests like to attend to places where the formal atmosphere happens as is the main atraction of the night, however if you want to avoid it, there are other places you can spend these nights.