The film you're describing is Single White Female (1992), a psychological thriller directed by Barbet Schroeder.
Allison "Allie" Jones (Bridget Fonda) takes in a new roommate, Hedra "Hedy" Carlson (Jennifer Jason Leigh), after a breakup. Hedy's initial helpfulness escalates into a disturbing, identity-stealing obsession: she copies Allie's appearance, infiltrates her relationships, and ultimately turns violent.
The film spawned a 2005 sequel (Single White Female 2: The Psycho) and remains the definitive "obsessive roommate" thriller.