I'll start with the common points.
Both are metal-frame DA/SA automatics with a firing-pin-locking decocker/safety mechanism. Both are similar in general layout and have a fairly high bore axis compared to most newer automatic pistols.
Now the differences.
The Model 39-2 is an 8+1 single-stack pistol with an aluminum alloy frame, individual screw-on grip panels, and a separate mainspring retainer. (The similar Model 39 "no-dash" generally uses a steel frame, but is far less common and resultantly more expensive than the alloy-frame M39-2 due to collector interest.) The backstrap is prominently curved, the front sight is integral with the slide, and the rear sight has a thin metal blade that screw-adjusts for windage only. The M39-2 is a so-called "first-generation" S&W metal-frame centerfire automatic, so it lacks a trigger-actuated firing-pin safety and relies on an inertial firing pin when off-safe; this results in less single-action trigger takeup, but a loaded M39-2 can potentially discharge if dropped hard enough on the muzzle with the safety off, and DA off-safe carry is not recommended by S&W. Other 1st-generation design features are the use of a separate barrel bushing a la M1911, and the decocker/safety lever is found on the LH side only. Lastly, the pistol was offered in blued or nickel finish; blued pistols have an anodized frame finish that tends to be somewhat fragile and shows holster wear easily. The pistol will accept 9rd mags made for the 3rd-generation 909/3904/3906/952.
The Model 5906 is a 3rd-generation S&W with a number of design enhancements, notably a one-piece wraparound plastic grip that doubles as the mainspring retainer, a coned barrel and fixed barrel bushing, a beveled magazine well, ambidextrous decocker/safety levers, a trigger-actuated firing-pin safety, and a dovetailed and easily-replaceable front sight. The pistol was designed for a 14 or 15rd double-stack magazine and will accept several types of extended mags. Due to the double-stack mags, the grip is much wider than the 39-series—awkwardly so for some small-handed shooters—and the backstrap is less curved. Both the frame and slide are stainless steel, so it's substantially heavier than the M39-2; this is good from a recoil-management standpoint, but bad from a carry standpoint. 3 types of rear sight were offered: a drift-adjustable vertical blade, a drift-adjustable slanted Novak type, and a fully screw-adjustable unit with large (and arguably unsightly) protective metal wings. (Take note that the 3 types of rear sight are NOT interchangeable because the slide dovetails are different sizes!)
FWIW the closest 3rd-gen equivalent of the M39-2 is the M3904, but it was only offered in matte blue finish. Conversely, the closest 1st-gen equivalent of the M5906 is the M59, which was offered in blued and nickel finish like the M39, and has a more blocky grip shape than the 3rd-gen double-stacks. All-stainless S&W autos were introduced in the 1980s with the 2nd-generation M639 and M659; there were no stainless 1st-gen pistols.
That should tell you what you need to know and then some.