In version 4.8 it is possible to call a function with a provided timeout as described in this answer. However, this functionality seems to have serious problems as described in this issue on GitHub and was therefore withdrawn in version 4.9 as stated here.
There is no convenient way (and with convenient I am rereferring to some sort of build in functionality) to achieve what you desire in the current version of plain GAP if we consider the GAP reference as a complete description of its capabilities.
However, using the parallelization options described in HPC-GAP, we could start our calculation in a separate thread, while letting the main thread checking the exceeded time. I have never used it, so I am not sure if this would actually work. I tried it, but failed.
We could also embed the entire GAP system as a C library and call GAP functions in a C program. We could easily monitor the runtime within this program.
Also, and already mentioned by Ethan Bolker in the comments, you can write a GAP program and call it via a shell script. Monitoring the runtime there is also possible. The procedure is described in this answer.
It might also be convenient in some cases to use the GAP interface in SageMath.