My google app script is iterating through the user\'s google drive files and copying and sometimes moving files to other folders. The script is always stopped after 5 minute
Also, try to minimize the amount of calls to google services. For example, if you want to change a range of cells in the spreadsheets, don't read each one, mutate it and store it back. Instead read the whole range (using Range.getValues()) into memory, mutate it and store all of it at once (using Range.setValues()).
This should save you a lot of execution time.