You use a benchmarking program, it will run tests, and then give you scores and an overall score.
Most are free downloads, with the option of a paid version with more tests and premium support.
Futuremark (previously MadOnion.com) has the
3DMark and PCMark ranges of products, along with numerous other benchmarking tools.
SiSoftware has the
Sandra benchmarking suite. It has tests (modules (icons)) for almost everything in your computer. It also has heaps of diagnostics tools. Be warned of the extremely disorganised website, but the program is really good.