What should a pilot do if they feel sleepy?
If a pilot is not rested enough to safely operate the aircraft, they should not fly. If a pilot is flying and falling asleep, they should switch out with another pilot or land.  

Current FAA regulations for domestic flights generally limit pilots to eight hours of flight time during a 24-hour period.

For the Air Force, actual flight duty periods vary depending on the aircraft type and mission but we are required to get 12 hours of crew rest with the opportunity for 8 hours of uninterrupted rest prior to flying.

You can read the FAA's Fact Sheet on Pilot Flight Time, Rest, and Fatigue here.