If the model is based on an differential equation, then add an event with Zero condition: return t - yourLimit;
where t is the time variable and yourLimit the maximum you want.
As action, enter: _pause();
This will stop (_pause()) your simulation exactly at that time.
Notice that, if the event is of the "State event" type, you should not continue playing it. If you want to allow the user to continue playing, set the event type to be "Zero crossing".
If the model is not based on an ODE, then you need to add to your Evolution page the code if (t>=yourLimit) _pause();
This will pause your simulation whenever t reaches or exceeds yourLimit. (numerical round errors permit).