I'm getting some new amiibo's for Christmas, and I want to train them while I'm AFK, but the problem is I don't know if the gamepad can stay on for more than an hour some how.
In my experience, the gamepad never turned off while charging. In other words: Keeping the power cord plugged in should ensure that your gamepad will never turn off as long as the Wii U doesn't turn off by itself. At the very least, I've been able to leave my Amiibos fighting each other for over 1 hour and a half while playing on my other consoles or PC in the meantime. I never encountered any problems then.
The Wii U itself can be set to never automatically shut down. This is done under:
Settings > Power Settings > Auto Power-Down where you can either enable or disable it. When you enable it, you will be asked to choose how many hours (from 1 to 12) the Wii U can remain idle before turning off. Simply disable the feature to get rid of it.