For some places it requires you to establish a domicile, be an independent (as claimed on your tax return), and live in the state for 12 consecutive months without attending an institution of higher education and be gainfully employed. At least that's the way it is in Texas. Documents to prove you have established domicile include a driver's license, voter registration, utility bills, lease agreement, income tax forms, or proof of purchase of a homestead.
Oh, and you can be a resident of two states. Employees of Los Alamos National Lab are NM residents. But because LANL is run by the University of California, employees also have CA residence. But then you have to work at Los Alamos National Labs....