All that is required is good manners. Normally people excuse themselves if they have to leave early, but I'm sure that you will be well aware of that from general life.
During the day there is a civilised informality about the ship. In my experience it isn't as grand as Cunard would have you believe, especially from the American brochures. This is not, in any sense, an equivalent of First Class on the real RMS Queen Mary, and is in fact less grand than the desperately missed RMS Queen Elizabeth 2. That had a quality about it that was grand English Country House about it - QM2 is more glitzy. More American in many ways. Not that there is anything wrong with America.
The evening is different. It is more formal. Black tie (tux for those on the wrong side of the pond) is the norm, but far from exclusive. A good lounge suit (business suit) is perfectly acceptable. You're students, so probably haven't the money for a good lounge suit and a good dress suit. One good lounge suit should be in the wardrobe of any man. It will do you EVERY night in the Britannia Restaurant - or even the Queens' Grill.
Your girlfriend can no doubt mix and match accessories to enable double use of a dress on more than one occasion - I gather that sort of thing is quite possible. Not my department however, being a bloke.
If you want to come by sea, which you clearly do, then QM2 is the way to do it, now that RMS Queen Elizabeth is no more. Don't be put off by it - most people on board are perfectly normal and live perfectly normal lives.
Have a great time.