We can make use of the Supervisor Rule to set this. Please select the condition "Hours since Pending" "Greater than" "xx", where you enter the number of hours and by setting the Action as "Set status as" "Closed".