In the legal systems of Great Britain, the United States, and many other countries, there is a legal idea called "habeas corpus." I think that this is what you are asking about.
The idea of habeas corpus is that a person cannot be put in jail and kept there for a long period of time without being charged with a crime. This idea (which is seen as far back as the Magna Carta) was devised as a way to prevent the government from putting people in jail indefinitely without giving them a trial.
In modern times, if a person is being held without being charged, the person's lawyer may file for a writ of habeas corpus. A court will then order the government to release or charge the person.