Can somebody help me to figure out how you determine how long you have to live in a state to establish residency?

..If I get accepted into a graduate school outside of Texas I DO NOT want to have to pay out of state tuition and need to find out how long I would have to live there (wherever it may be) in order to be elligible for in-state tuiton.

2-Swole