Hi @Ale,
A model will keep running as long as it has events scheduled, or until it is stopped manually or programmatically (using the stop() command).
For your model that keeps running, most likely there is something like a repeating time table that will continue to create events forever. If you're curious to know what events are still coming up that enable the model to keep running, run your model until after it should have finished, then open the Event List to view events that are scheduled in your model. Open the Event List from the main menu, under Debug.
Since the model has some sort of event that will continue running indefinitely, you need to decide on some event that you can listen for yourself, and stop() the model when your completion-conditions are met.
For instance, if you know that 100 parts need to be processed, after which your simulation is complete, you could use an OnEntry trigger on the Sink. Once the Sink's input reaches 100, call stop() to stop the model.
Often it will be a more complicated set of conditions, but either way, you keep track of what conditions have been met, compare it to what conditions need to be to indicate completion, then stop() the model when appropriate. You may need to save state flags on labels or with a Global Table to determine when all the conditions have been met. It is very much dependent on how you built the model and what the constraints are as to how exactly you will track when the model is complete.
Perhaps other voices will chime in with additional ideas.