Before leaving a social event, be sure to thank your host and hostess in person. They put a great deal of time and effort in the preparation of the event you attended and would appreciate hearing how much you enjoyed yourself.
At a large event, such as a wedding, you may have to find the host and hostess and wait while others bid their farewell. You should allow time in your departure for this.
In addition to thanking the host and hostess in person, send a handwritten thank you note within the next day or two telling them what a wonderful time you had.
A handwritten note is the preferred means to express your appreciation, but a phone call or an e-mail is better than nothing.