Depends on how complex the algorithm is, a simple one can go for a long time, a complex one might run into an edge-case you haven't coded against, it might randomly be denied access to it's fetched CSV, or it might randomly take longer than 50 seconds to execute a piece of code and time out. I have trouble getting one of mine to run longer than 1 week consecutively. Something ALWAYS comes up... and the more edge cases I protect against the more likely it is to time out. I've seen a lot of WEIRD shit live trading, I've had them glitch out, then quantopian will restart it (don't know the criteria for this) and it doesn't run the before_trading_start() code which caused an error. I've had the pipeline fail to load after market holidays. Orders that fail to cancel, robinhood reporting stocks I don't own, etc. tons of stuff.
I learned early on to code all my algorithms so that they can be stopped and started without losing the logic behind the trades and I put lots of flags that detects when a peice of code hasn't ran yet and runs it if it hasn't. It's a pain TBH but a good learning experience in how to have a blancing act withrobust code and optimized run speed. I've had to scrap features because they caused a rare edge case that took too much computational power to check against.