In The Empire Strikes Back, when Lando sells out Han and the good guys to the Empire he arranges a meeting where he leads Han, Leia, and Chewbacca into an ambush. When the doors open and Han sees who is in the room, he reacts immediately and shoots at Vader. Why does he do this? Is Vader so well known as a bad guy or is it because he recognizes him from the few seconds he saw him escaping the death star?
Most rebels would recognize Darth Vader in the same way that many WWII soldiers would have recognized Hitler, even though they never saw him in the flesh. Photos and verbal descriptions would be enough. But Han had seen Vader fighting Obi Wan on the Death Star, and then he joined the rebellion for several years. It is a near certainty that during this time someone in the rebellion would have briefed Han up on the giant guy in all black armor that he saw, assuming of course that Han didn't already know who Vader was since presumably someone that high up in the Empire would be relatively famous.
As to why Han's reaction would be to draw and shoot as fast as he did: instinct. Despite what George Lucas would have you believe with his silly retcon, Han Solo was happy to shoot first and dispatch a dangerous enemy if the opportunity presented itself. When suddenly faced with such an immediate and deadly threat, Han's first instinct was to shoot.
According to the new canon novelisation of A New Hope, Han know of Darth Vader (from rumours and hearsay) well before he met Luke and Obi-Wan.
Seeing him fighting with Kenobi on the Death Star I is the first time that he's directly encountered Vader, but his armour and stature are apparently immediately recognisable.
Two figures—one as black and shiny as a smear of oil, the other hooded in a thick brown cloak—circled each other. Their lightsabers vibrated in their hands, as different from each other as their owners were. One was sky blue, the other crimson—like burning blood.
So that was Darth Vader, huh? Always terrifying to realize rumors weren’t exaggerated. The man—creature—thing was a giant, towering over the old man. His armor looked thick enough to keep him alive even in the freezing vacuum of space. The lights on his chest panel flickered, the way a droid’s would.
The canon comic Star Wars Vol. 1: Skywalker Strikes (set directly between A New Hope and Empire Strikes Back) makes it clear that Vader is immediately recognisable by Chewie as well.