That depends on why the venture failed. Google would have failed financially without someone coming up with the idea of attaching advertising to search. Although in my view, and despite better financials, Google has failed socioeconomically, I digress.
I once turned a fledgling consulting company the founders were tired of into a product company, raising a fantastic series A and selling the company six years later for a lot of money. So, clarify why your company failed, and there may be some recourse.
In general, and by the subprime thesis deployed by the overwhelming collusion of innovation arbitrage (VC), most entrepreneurs are instructed to develop recognizable downstream sub-optimizations from an existing normalization of truth. Given there will be many opportunities for concurrent downstream branches, a pivot to another branch may turn your luck around quickly.
Of course, downstream innovation pales in comparison to repositioning the company towards a new and higher normalization of truth that has no precedent. Such upstream innovation can fundamentally change the outlook of the company, assuming the normalization is an accurate and acute one.
So, how long you wait depends on your ability to pivot and in what direction, the best pivot being upwards.