vcgencmd stands for "VideoCore general commands", and it allows the user to send commands to VideoCore. VideoCore is the low-power multimedia processor used on the Raspberry Pi.
vcgencmd enables you to do various things like measure the clock speed, measure voltages, and of course, get the core temperature. To see all available commands you can run:
If you're going to use this in a program, you can parse out the temperature using something like this:
$ vcgencmd measure_temp | sed -En "s/temp=(.*)'C/\1/p" 51.0