Depositions are most often used in civil cases. But that doesn't have to be the case. Depositions can be quite effective in criminal cases as well, especially cases that have out-of-town witnesses, or others that may later become unavailable for trial. The latest issue of The Champion, the newsletter of the National Association of Criminal Defense Lawyers (NACDL), has a good article about Taking an Effective Deposition in a Criminal Case.
Chapter 39 of the Texas Code of Criminal Procedure governs depositions for criminal cases in Texas. That is the place to start if you think a deposition might be appropriate for your case.
*A note from past experience: If you are planning to take a deposition of a foreign national in another country, please be sure to research the host nation's laws on depositions. I almost messed that one up with a deposition I had to take in Okinawa.