@Roberto Sancho , currently yarn does not have feature to time out the application. YARN-3813 is apache jira tracking this feature.
For now. you will need to write a long running script, which can monitor each application's state and kill if it stays in accepted state for long time.