This is not always the case. For example, the Fugitive Slave Law required escaped slaves to be returned to their masters by Federal Law.
Also, there was a distinction between 'sojourning' and taking up residence in a state. So, for instance, if you passed through a free state when traveling and then voluntarily went back with your master, you were not considered freed. Even temporary residence was a concept that had to be considered - how long did a master have to live in a free state to free the slaves he had with him. Usually even then a voluntary return was usually considered to return the slave to full slave status.
Dred Scott was considered an even grayer area as he lived in territories that were free by Federal Law, as well as a free state for a time. He might well have been considered a slave by the various sojourning rules as he came back, if the topic had not been taken up as a political issue by the Courts to try and 'settle' the slavery issue by Judicial diktat. This failed miserably, and led to more sectional strife than before.
EDIT: This Wiki Link Shows several court cases about slaves suing for freedom. Some were even binding in the original slave state (Rachel vs Walker). Note the absurd politically driven decision of Dred Scott, which is contrary to actual fact, since free blacks and freed blacks had always been considered citizens since colonial times.