In many cases, the first port of call in attempting to identify a port or other component would be the manual. This is especially useful in the rare cases where a port doesn't follow a specification, for example with laptop docking ports. Always RTFM the manual is probably the simplest, most correct source of information.
To a significant degree most ports and connectors on PCs are standardised, and there are resources to identify what they look like, or the symbols that identify them.
I'm rather fond of the computer hardware chart done by Sonic840 on Deviantart (CC BY-SA) for a visual guide to common physical ports (Though, it doesn't show USB 3.0 yet, or the three different common colours for USB ports - Yellow for charge, black for 2.0 and blue with more pins for 3.0).
(Medium sized version here, Full sized [4320 x 6120px, 24MB] version there)
I've also found for 'generic' connectors, ifixit has a nice guide to them, naturally focused on connecting and disconnecting them, rather than identifying them. Still, knowing something is a ZIF connector can be useful.
If you know roughly what the cable is for wikipedia might be a good place to look, with articles on Video Connectors as well as general sorts of computer connectors
They also have common symbolic representations, though, they seem to be standardised by different organisations - which may be especially useful with legacy ports. In some cases, this may be a pictogram of the intended purpose of the port (for example printers for parallel ports, IOIOI for serial ports, and mouse and keyboard symbols)
The location of ports may also be a clue - for example docking ports are typically at the bottom of a laptop. Internal connectors may often be of various molex types, and their electrical layout may not hint at their purpose.
While this is an attempt to cover most of the cases, there's some situations where users have asked some questions on SE.
I've attempted to catalogue them here by type to make them easier to find
HP Docking Port
Lenovo Mini VGA
Mini DVI and others
KK type connected to USB
Laptop GPU slot (mxm III)
Internal display connectors
LVDS and eDP
CD rom drive analog connector
RGB LED Power
4 pin header
Weird USB cable (usage?)