When you are attending an event as couple, the person who has the tie-in to the event is the one to determine when to leave. The rule of thumb is that the time to exit and who suggests it to the host should be discussed before the event.
Also, do not depart in a herd. This means to wait and give the host space to properly say good bye. Follow these guidelines and you will always exit gracefully.