You file two state tax returns (assuming both states have an income tax). This is the general rule: The income is work state (WS) source income since it was earned there. Resident States (RS) tax all their resident's income, regardless of where earned. You will file a non-resident tax return for the WS and report the WS income. You will file a full year resident return for the RS, reporting all your income. The RS will give you a credit, or partial credit for any tax paid to the WS.
For state filing requirements, the WS does not go by what you earned in their state but by your total income . For example, if WS has a $10,000 filing requirement and your total income for the year was $15,000; you would be required to file even though you only had $300 of income in that state. But if you total income was $10,000 your would not need to file.
Filing Requirements: https://ttlc.intuit.com/questions/2903200-do-i-need-to-file-a-state-return
If you have a reciprocal state situation, the answer is different. See https://ttlc.intuit.com/questions/2895760-which-states-have-reciprocal-agreements
If one of the states is CA, reply back with the names of both states for possible different instructions (the WS may be the one giving the credit).
There may be some question as to whether having the apartment constitutes residency in the WS, but that's best left alone unless the other state contacts you.