Yes I know this was on Tumblr as a joke but then I started really thinking about it and wanted to know, Google has been no help
Writing from a more Western Europe perspective and with connections to the archaeological sector, the anecdotal answer is '100 years' (within the sector/field) although this does of course come with some caveats and exceptions and I will expand on this. This is my first attempt/answer at /r/AskHistorians, please don't eat me, mods!
Why 100 years?
Well, generally, after 100 years, those that have died and would be being excavated/dis-interred will have passed out of living memory. Theoretically, there is a suitable and respectable distance of roughly three to four generations between those who have died and people now. There has now been one hundred years of distance, other history and other memory building up. Excavating remains from then is - theoretically - less contentions and less charged with emotion. To the local community, people being excavated from one-hundred years ago are not remembered by them, by and large. The community everyday memory (Assmann calls it the 'communicative memory') of them has gone.
In the United Kingdom, if one is excavating an area with a known cemetery or graveyard, the public and relatives have to notified first. Unlike grave-robbing which - theoretically, having not done it myself - happens in the dead of night, no questions asked, you have to give notice of intention, there may be community archaeology projects, there will likely be local public information sessions. And as mentioned before, three or four generations will have passed. Great-grandpa might remember that his grandfather was buried in that cemetary in 1919, that grandfather has passed out of living memory, excavating great-grandpa's grandfather is less contentious and charged with emotion. All remains will be re-interred.
If human remains turn up on an excavation unexpectedly, the police and coroner have to be informed, a license has to be obtained, and they can/should only be lifted from the ground if they further scientific knowledge.
Caveats and Exceptions: Jewbury Cemetary and World War I
The centenary for World War I only finished in 2018 and it makes sense that, therefore, traditional archaeology is very cautious about touching on the field - it was 'too young' for archaeologists. However, there has been some what I would consider grave-robbing, where, from roughly 1919 to 1990 (Saunders 2010: 10) people local to the sites (and enthusiasts from elsewhere) would go digging for souvenirs, including human remains. There was also well-intentioned (but ignored by the professionals) amateur archaeologists and historians who excavated and recorded. Formal archaeology only started paying attention from the 1990s onwards, fittingly approximately eighty years after the start of WWI. So, the rule still stands but the question then becomes, if a topic is contentious and important, expecting (local and/or concerned) people to wait around for eighty to one-hundred years until some professional (and often) outsiders to come in and do it 'properly' is not necessarily feasible.
On the flip side, Jewbury Cemetary was the cemetery where medieval Jews in York buried their dead during the eleventh and twelfth centuries until their expulsion from the UK in 1290. Well, Sainsbury's (a supermarket chain) wanted to build a car-park on that land back in the 1980s, although it was unclear at the time whether or not the land that they wanted to build their car-park on was where the cemetery was. The excavations were contentious and limited, with analysis of the human remains not done to full extent that they could be, and they were reburied in 1984 at the wishes of the local Jewish community.
Edited to add because I did not make it clear: Jewbury clearly passed the 100 year rule, however, that cemetery was abandoned and the location of it forgotten because Jews were forcibly expelled from the UK. Jews now are still a minority and marginalised group in Britain and having their heritage excavated can be stressful. The excavation and post-excavation processing was neither as long nor as detailed as the archaeologists would have liked, due to wishes of the local community, which they respected.
Conclusion
The 100 year rule roughly works, except when it does not: for minority groups and for contentious sites and areas. There is always a lot of emotion around human remains and there should be. I think if you asked archaeologists if they were grave-robbers, they might agree but wince. There's much more nuance and archaeologists (at least the ones I know) hold themselves to high standards. I'll finish with a quote from the British Archaeology Jobs Resource (an industry support/lobbying group) guide on excavating human remains:
Please treat all human remains with the respect and dignity they deserve at all times. It is a privilege, not a right, to excavate human remains.
Sources:
Assmann, J. (1995). Collective memory and cultural identity. New German Critique, (65), pp.125-133.
McComish, J. (2000). The Medieval Jewish Cemetery at Jewbury, York. Jewish Culture and History, 3(2), 21–30.
Saunders, N. (2010). Killing Time: Archaeology and the First World War. 2nd ed. Stroud: The History Press.
I am not an archaeologist, nor am I deeply acquainted with the academic debate of this topic, though I have a cursory knowledge. Enough to know where I stand, anyway. I'd like to offer my viewpoint as an Indigenous person and one who focuses on Indigenous Studies.
The answer for me is: it will always be grave robbing no matter how long the person has been dead.
When conducting any kind of research, it must always be ethical. This includes research involving the deceased. Academic professionals work within ethical frameworks that have been developed over many years of a discipline's existence that guide the work in a way that assures it conforms to the accepted practices and responds appropriately to the social norms that birthed the context for the ethics in the first place. Furthermore, there have been laws and regulations developed around archaeological work and how to handle particular situations, such as the discovering of human remains. But there is a key part to note in this--it is the social norms, or the cultural foundation of a group, that produce the ethics. The ethics I apply to my work are not going to be identical to a colleague of mine even in the same field who does not share my background, though they may intersect or be highly similar.
So to understand your question, we must first be aware of the ethical nature of the researcher and the community they find themselves in to assess the appropriateness of studying graves and human remains. It is often contended that those outside of "living" memory or with no direct connection to the deceased person are categorized as OK for study. In more recent times, this has been expanded to have a broader meaning:
This cited National Geographic article also highlights the differences between cultures and how they approach the emotive nature of death. It noted how some people actually approve of research being conducted on their ancestors. But my motivation for writing this answer centers on where we see disapproval.
This kind of topic has particular meaning for Indigenous Peoples, including my specific Tribe, since we have historically been subjected to what we consider unethical and abhorrent practices when it comes to the exhumation of graves--of our ancestors. As I previously discussed in this Monday Methods post, conducting research with Indigenous communities comes with its own expectations and ethical framework that researchers must abide by if their research is to A.) be conducted in a respectful manner and B.) ultimately yield the results they are looking for. Disturbing graves, even of those long passed, is often a grotesque act with little room for exception. Arguably the most notable case in recent memory is Kennewick Man, the name given to remains found in 1996 along the Columbia River. Despite assertions by the surrounding Tribes, it was a 20+ year fight to have the remains returned for burial that hinged on verifying the ancestral connection of this individual to the Indigenous population of the Americas. Though it was scholars who were leading the charge to retain the remains for scientific study, Indigenous Peoples--and Indigenous scholars today--reject the fundamental ideals and values at the heart of the arguments by the academic community because many of us have a diametrically opposed viewpoint of how remains should be handled.
In describing the difficultly of archaeological work around human remains, the Encyclopedia of Global Archaeology explains:
While death is biological, it is also an inherently social process, particularly given the proposition that the dead still have human rights. It is the dichotomy between human remains as utilitarian objects of scientific interest and human remains important for their cultural, symbolic, and spiritual value that raises many ethical questions for those studying or working with human remains, whether from archaeological or forensic contexts.
Sociocultural attitudes toward the dead should be considered by practitioners dealing with the deceased. While the living body is usually regarded as a person, it has sometimes been argued that after death, the body becomes merely an object. In the forensic context, the body (object) is regarded at one level as empirically unchallengeable evidence. This is particularly relevant to those dealing with human skeletal remains.^1
For many Indigenous Peoples, the protection of our ancestors is not only a matter of ethics and moral uprightness, it is also a matter of social justice and sovereignty. Exhumations and discovery of artifacts that pertain to Indigenous cultures that neglect our involvement in these matters perpetuate colonialist mentalities that keep us socially marginalized and pose an affront to our inherent sovereignty by removing us from the table even when the subject relates to our people, those whom we have jurisdiction over. Perpetrators against our graves disregard "our views, beliefs, and rights because colonialism instills the colonizer with a notion of absolute entitlement--a notion that denies the colonized the respect and rights afforded to other humans."^2 Though we have seen positive steps toward resolving these ethical (and political) issues in the last 30 or so years, there is still much progress to be made to redress the impacts of many centuries of abuse and theft.
With this in mind, it becomes very difficult for an Indigenous scholar (or any scholar holding to these ethics) to put the value of a human life on a timescale. Doing any kind of historical work should be done with respect for those of the past, recognizing that they were living beings--beings that, for many of us, continue to carry on. /u/commiespaceinvader has previously written about this when addressing how empathy is "the central skill of historians. This empathy does not end when a person has passed. And I'd reckon that for most Indigenous persons, it will never end.
Edit: Couple words. And some dates.
Footnotes
[1] Soren Blau, "Ethics and Human Remains," in Encyclopedia of Global Archaeology, ed. Claire Smith (New York: Springer-Verlag, 2014), 2453-2458.
[2] James Riding In, "Decolonizing NAGPRA," in For Indigenous Eyes Only: A Decolonization Handbook, eds. Waziyatawin Angela, Wilson & Michael Yellow Bird (New Mexico: School of American Research Press, 2005), 53.
As an archaeology-adjacent musem professional, there isn't a hard and fast rule. However, at least in the UK, remains over a century old are generally regarded as archaeological. Due to the 2004 human tissue act, at under a century old, they fall under the provision of the Human Tissue Authority and consent either by the individual or a relevant person (e.g. a family member or partner) is required to display them e.g. in a museum or to use to educate medical students. They may still sometimes need to be exhumed and moved, for example if there is a landslip in their burial place which has exposed their remains or if they are being moved from a burial to a crypt. Legally, this is not grave robbing, as it is done under license and with permission. You also have to apply for a special license to excavate archaeological human remains. There are also extra legal complications where the land belongs to the Church of England or is a scheduled monument or where the site is subject to specific acts of parliament.
Current archaeological best practice is to respectfully return human remains over a century old to either where they were found, an appropriate nearby site, or - depending on the situation - repatriate then, once scientific study has been conducted. For example, the Scottish Soldiers project in Durham, which dealt with part of a mass burial of prisoners of war who had been held in the cathedral during the civil war, was unable to repatriate them as it was unclear where they should be repatriated to; some of the remains seemed to be those of German mercenaries, and others were from a wide variety of places within Scotland. It was also notable that - due to the way in which the excavation was carried out and that there are buildings over much of what is presumably the rest of the grave - some of the remains were not complete. Ultimately, the decision was made that they would be reburied with a memorial service less than a mile away. It is also best practice not to excavate or disturb a site unless there is no other option - for example, if a site is threatened by building work or is going to fall into the sea or off a cliff, as at Birdoswold Roman Fort.
Inside the UK, there is also an ongoing campaign by Arthur Pendragon, the neo-pagan chief druid, to have human remains (approx. 5000 years old) which were removed from Stonehenge in 2008 returned to the site and reburied, as well as against any of these being put on display. This was denied partly due to the lack of cultural continuity with these remains or particular connection to them; many people inside the west country could similarly claim to be descended from them. It's an interesting case because of his use of language which is extremely similar to claims against museums and archaeologists by Indigenous people, which I think is fairly unique inside the UK. That itself is a particularly thorny issue, and one where museums should be questioned (as in the case of the toi moko which are held by the British Museum, and where they have essentially hidden behind the legal framework to avoid repatriating them to Te Papa Tongarewa where they could be studied and repatriated to the appropriate kin groups), although his claims do not have the same moral weight as those of Indigenous groups.