Are thank you notes a lost art? Not at all!
If someone has done something special, or given you something of value (whether you wanted/like it or not), it is always appropriate to send a thank you note.
For job interviews, an emailed thank you note should be sent within 24-48 hours, as hiring decisions are often made quickly (though following up with a handwritten note is certainly a nice gesture as well). In addition, be sure to send a separate, individualized email to each person with whom you interacted.
For most gifts, notes should be handwritten and sent within two weeks, though you are granted a little leeway (4-6 weeks) if the gift is for a wedding.
Finally, for other special favors, invitations, or gifts – two weeks is acceptable, but one is better. On this final point, I often get questions about what is a special favor...the answer is anything that someone took extra time to do for you (yes, even if it's 'part of their job'). It's never bad form to be appreciative of someone else's time/efforts/sacrifice!