Shortly after you depart the plane... Depending on which jetway you come in at, they are there when you are heading into the airport.

Also, when you leave, there is a kiosk just before customs that the rep takes you from to the front of the line.