Special Agent Sam Stanley is a fictional FBI agent played by Kiefer Sutherland in the David Lynch movie, Twin Peaks: Fire Walk with Me. Assisting Special Agent Chester Desmond, Stanley uses his forensics expertise to investigate the murder of Teresa Banks. Gordon Cole mentions that he cracked the "Whitman case" (In the shooting script, Stanley examines Teresa Bank's body with a special machine that helped him to do this and in a latter deleted scene he showed this to Dale Cooper at his home).
In a running joke, he repeatedly estimates the value of buildings in Deer Meadow. The Deer Meadow segment is an opposite of Twin Peaks with characters and locations functioning as mirrors of each other (whatever is friendly in Twin Peaks (police officers, diner) isn't in Dear Meadow, and Desmond and Stanley are as rejected in Dear Meadow as Cooper is welcomed in Twin Peaks). By this logic, Sam is the opposite of Albert Rosenfield.
Sam Stanley was actually mentioned once in the original series. In the pilot, during the scene in which Agent Cooper is examining Laura Palmer's corpse, he speaks into his dictaphone something along the lines of: "Don't bring it to Sam, Albert's a little more on the ball with this." Lynch most likely created the character from this line.