A Power Automate flow can run for as long as you need it to, provided that there is an active trigger. Once the trigger is no longer active, the flow will automatically stop.
Other related questions:
What is the limit of Power Automate?
There is no limit to the number of Power Automate flows that can be created in an environment.
How often can a Power Automate flow run?
There is no limit to how often a Power Automate flow can run.