How long can the Catholic Church be without a pope? According to Wikipedia the longest papal election in the history of the Catholic Church was from November 1268 to September 1, 1271.

How long can the Catholic Church be without a pope so that we can say that the succession was broken?

If there is defined no length of time, then if simply we don't need a pope for three hundred years, we can wait that long to elect one and papal succession would remain unbroken.
You would have the succession, since the Pope would be the valid successor to his predecessor. So there is no break in succession. But the Church would be limping, as it were, until its proper order is restored. You don't need a Pope to be Catholic; it's just that Christ instuted the Church with a Pope, and so it is definitional to the heirarchical structure of the Church that He wanted (it's therefore not negligible). A flock can only remain on course for so long before it scatters. cf. John 21:16; Matthew 26:31; Luke 22:32.

If you were born and died during Sede Vacante ('vacant Seat') period (meaning a valid Pope yet to be elected; and there is no current Pope), you are no less Catholic because of that, for example. All Popes, virtually without exception, die before there is a new Pope—it is the normative process of election. Pope Benedicts XVI's recent resignation is extremely, extremely rare.1

There were (disciplinary) rules put in place by Popes to minimize the amount of time it takes for the bishops (cardinals) to elect a new Pope. A striking instance was the Papal bull (or document) issued by Pope Gregory X called Ubi Periculum (papal documents are named after the beginning sentence or a beginning sentence in the Latin document—here, 'Where [there is] danger' ("...of a long vacancy"). But the stringent measures (deitary in nature) prescribed therein, to prevent long periods of sede vacante, were done away with by his successors (being a disciplinary matter, not a doctrinal one, Popes can, and do, undo what their successors judge to be right for the time).

We now have a working system, and trust that God will provide for His people in difficult situations for these, and rectify them before too long, just as He has in the past. He won't allow the gates of Hell to prevail against His Church. Matthew 16:18.



"If there is no time set up then simply we don't need a pope for let's say 300 years and elect one then and say we still have a succession of the popes"

This is just speculative, and not really realistic, nor productive. Not to mention that it would be true that succession is retained in such a scenario. If another valid Pope is elected, then he is Pope. It doesn't rely on the proximity to the last Pope's death or election.

It has more to do with the Church being without a head (earthly, I mean), contrary to the institution of the Church as such. Matthew 16:18-19b; Isaiah 22:22-23. A lengthy period in which there is no "a father to the inhabitants of" the Church, is indeed a danger or risk ("periculum") to the Church's health as a society. Much like a family can exist without a "father," but is severely detrimented if he is not there for whatever reason. 



1  The last 'resignation' of a Pope was six centuries ago. It is estimated that only 10 or so (at most) Popes have ever done so, under quite different and varying circumstances.