What I mean is that in most sciences, as you go back in time, the details of an analysis become increasingly sketchy. You wouldn't want to trust a 1971 textbook on things like cell biology because the details have changed so much in the past 50 years. The broad sketch would probably be fine, but the details would be off-key or flat-out wrong.
So, similarly, how old can historical research on, say, Ancient Rome be before they become dubiously trustworthy? Are there specific things that should be monitored in older works that are otherwise accurate? Are there specific dates before which historical information definitely should not be trusted?
As a professional historian, one of the things you have to become good at is reading older scholarship for value and content in light of what either was not known then, or what was accepted as a prevailing ideology at the time that shaped interpretations. That affects some subfields of study in different ways than others, and it's harder to know for certain outside of one's own subfield just what the specific contours are. In that way, it's like the natural science example you give, but it's also possible to have large areas of research that haven't been superseded and are thus valuable even if the interpretations have changed.
For example, in South African history, there's an annoying tendency to presume that anything produced before 1994 in the country has a taint to it; we as specialists know that's not the case, because historians were at the forefront of challenging apartheid. But this impression still tends to hold for scholarship in Afrikaans, especially among native speakers of English, when in fact a lot of that scholarship was also deeply subversive and has not been superseded in terms of raw information. One must monitor these works--like all scholarship--for ideological presumption and selection bias, but the raw research is still quite useful even where the analytical interpretation has flaws or omits data that was not yet known.
Knowledge of where those blind spots were, why they existed, and what effects they had, are all part of a specialist's training. It's made harder by the knowledge that there is so much we might also get wrong based on our own values or missing information. The field of historiography thrives in part because there's a lot of specificity to each field's development and the succession of methodologies and theoretical constructs used to analyze the subject. This must also recognize that there's more than one way to analyze the same data, so it can be contentious even when contemporary.
So research analysis arguably has a shorter life than empirical data, but it's still longer than in the sciences--sometimes far longer, especially if a subject falls out of active study for whatever reason. The case I use for that is Lewis's general history of Somalia, which has remained largely intact since the 1950s despite new editions periodically. My Somali students have pointed out a bevy of incorrect or misleading things in it, yet it remains the authority with only periodic revisions in edition. In general, I eyeball anything on a popular topic in African history that's over ten years old with some skepticism. If it's a less traveled subject, I might give it twenty or twenty-five. Once we reach back into the era of the Cold War my alerts are fully raised, but I rarely dismiss anything out of hand unless it's been totally superseded, ideally many times.
The unsatisfying TL:DR is thus "it depends," and sometimes it reverses what's in your first paragraph: the details are still correct (if incomplete) but it's the broad sketch that turns out to be misleading.
It depends on several factors - how 'popular' an area of research is, whether any new evidence is likely to be uncovered, the prevailing trends in the historiography, etc.
It's not necessarily about details being wrong, per se, although that can happen, it's about how our understanding of a subject changes over time as different viewpoints are articulated, new methodologies or theoretical frameworks arise, and new areas of study are explored - and as certain methodologies fall out of fashion.
So, for example, David Chandler's The Campaigns of Napoleon is still considered a 'bible' for the study of Napoleonic military history, despite being fifty years old now, because it's incredibly comprehensive, impeccably researched, and there doesn't really need to be a replacement - but there's also not likely to be one, because military history has become an ever-more-niche subject; the way Chandler frames the campaigns - as Napoleon's, with little focus on any theatre where Napoleon wasn't present - is not a framework that a modern historian is likely to use anymore; because Chandler largely ignores political and economic factors where they don't impact the military history he is telling. That doesn't make Campaigns a bad book or wrong at all, but it does make it the kind of book that doesn't really get written nowadays.
In many cases, new sources can or will emerge. This is especially true for the history of periods after the invention of the Printing Press, where there are thousands or millions of pieces of source material exist that haven't even been looked at by any historians in detail yet. A deep study of a specific aspect of a topic - say, the sexual politics of the theatres of fin-de-siƩcle Paris - can modify, deepen, or even radically change our understanding of a place and time, and studies written before that will not reflect the new historiography.
Finally, we can reinterpret sources. Sometimes we do that due to the advent of new methods of analysis or new evidence - for example, a measure of the CO2 levels in the atmosphere during the Fall of the Roman Empire is a key part of Brian Ward-Perkins' analysis of the economic output of Late Rome and the decline in output caused by the collapse of the Western Empire, which shapes his revision to the then-prevailing trend in the historiography of minimizing the 'catastrophe' narrative of said collapse. Sometimes we do so simply because we think differently to those who came before us. Before the 1970s or so the prevailing narrative of Roman expansion was of 'defensive imperialism' - that Rome only expanded its territory when it was attacked, in order to form a buffer state. However, the historiography shifted, and since then our understanding is that the Roman Republic was in fact geared towards producing imperial expansion at a societal level. This change happened because the scholars who were interpreting the ancient sources changed, and the new scholars took a more hostile stance to imperialism.
So, as a conclusion: There isn't a specific date, but newer works tend to take into account newer methods of thought and analysis, newer frameworks, and will more accurately reflect - or at least mention - the general consensus of the historiography.
It very much depends on what type of work it is. Monographs covering specific topics will always be of some use to historians. But since you're talking about textbooks, I assume you don't mean monographs, but general histories. In this case, the answer is much the same as with biology: I would not trust something which is more than a couple decades old (if that). In my field, Ottoman history, many older surveys are still popular among non-specialists despite being horribly outdated, such as Lord Kinross' The Ottoman Centuries and Stanford Shaw's History of the Ottoman Empire and Modern Turkey. Yet historians' understanding of their topic has evolved dramatically in the past forty years, and these old works are certainly not reliable any longer and serve only to confuse and misinform regular people when they try to learn Ottoman history. It's made much worse in that much of Wikipedia is based on these older works with only limited reference to the new.