How long can a person be held in jail on a bench warrant in Texas as a witness?

A "bench warrant" is a warrant issued by a judge on his sole authority. Only the judge who issued the warrant can vacate the warrant. If he had to issue one to get you to court to testify, you probably won't be released until after your necessity in the court action is ended.