if you're talking about programmatically allowing your app (not somebody else's app) run for an hour, in theory you could set a timer for an hour, and when it runs down, call activity.finish.
but there are a number of problems.
you would need to run a foreground service in the event the activity is moved to background by the os. then you need to raise an event on the ui thread from the timer. then you have to make sure the app is actually running when the timer winds down. then, of course, there is the issue of a user's simply starting up the app again for another hour...
@Alessandro71 has pretty much covered your options.