Pilots typically sleep on long-haul flights. They usually take a break in the cockpit, but can also retire to the crew rest area.