Ping is measured from one system to another using the ping command at a command prompt. In other words, for a game you are testing the ping from your PC to the game server. On most games the ping is not as important as the jitter, which is how much the ping varies over time.
Generally, the lower the ping the better, however, if your ping times are:
20, 30, 15, 50, 20, 60. . .
There is a lot of variation between the best (15) and the worst (60). Your game might be more playable if it is:
60, 65, 58, 62, 65, 60. . .
Here the variation is less even though the average ping is higher.