You need to do this through the test runner configuration. (More details can be found here).
To set the test run time-out for all tests using the tests settings file
- Open Solution Explorer.
- In the Solution Items folder of your solution, double-click the test settings file. (The Configuration Settings dialog box appears.)
- Choose Test Timeouts.
- Check Abort a test run if its total execution time exceeds:
- Set the test run time-out value, in hours, minutes, and seconds.
- Choose Save and then choose Close.
For this setting to take effect, the test settings that you edited must be the active test settings. For more information, see How to: Select the Active Test Settings from Microsoft Visual Studio.