Yes you are correct. The grammar for this is known as a relative clause. 'Which' in this example is a 'relative pronoun', used to make one longer sentence from two shorter sentences: I had to accept it as my room or move out. I was not financially stable to move out at the time.
You could also say "I had to move out, which I was not financially stable to do, or accept it as my room."
The position of 'which' is always after a comma, and always after the thing you are adding information about. Notice where the commas go in each example though!