Before the 2005 changes to the bankruptcy law, a debtor considering bankruptcy only had to live in a state 90 days to enjoy the benefits of that state's bankruptcy exemptions. But under the 2005 changes to the bankruptcy law know as the Bankruptcy Abuse Prevention and Consumer Protection Act (BAPCPA), a resident must live in a state at least 2 years before the debtor can claim that state's bankruptcy exemptions.
For example, if you moved from California to Texas in December 2007 you would not qualify to claim Texas' bankruptcy exemptions if you filed for bankruptcy before December 2009. Likewise, if you moved from Texas to New York in December 2008, you could still file bankruptcy and claim the Texas exemptions as long as the filing is done before the 2 year cut off (December 2010).
Depending on a debtors assets and debts and the exemptions that he/she wants to claim it may be best to wait to file bankruptcy to claim certain exemptions (or not) according to what would best benefit the debtor. If you're considering filing for bankruptcy and have moved within the past two years, speak with a bankruptcy attorney to determine if you should delay filing for bankruptcy in order to claim the best exemptions available for your bankruptcy case.