Every guitar's got one. Are the frets lined up? Are any damaged? If so, test those out first.
Check the Action
What's the "action", you ask. Action is the space between the fretboard and the strings. You'll want this to be as comfortable as possible. The better your action, the better your playability.
Check the pick-ups. (Electric Guitars only)
Pick-ups are the plaques behind the strings where you strum. They pick up the sound and translate it out. You'll need these in tact if you're going to rock. If you're buying second hand, the seller may have stripped out nicer pick-ups and put in worse ones. Make sure you check these out.
These three are universal, you'll need to check them on all guitars you look at it.
5) Play the Expensive Ones - Try out the expensive guitars so you get a feel for them and can compare it to the ones in your price range. Then make sure the assistant shows you the guitars in the higher end of your price range first.
6) Check the Tuning - Before trying the guitar, make sure it is tuned to concert pitch or standard tuning. This acts as a good bench mark when comparing guitars.
7) Check the Feel - Try as many guitars as you can whilst sitting and standing. If for any reason they do not feel natural it is likely they are wrong for you. Once you find a guitar that feels good in your hands and on your body, then you have the right one for you.
8) Test the Frets - Place your index finger directly behind the first fret on the fattest string (E6). The fret is the raised metal "line". Now pluck the string with some force. If there are buzzes, pops, or odd noises there could be something wrong. Apply that hard pressure to check behind each fret on each string. If there is any "non musical" noise, ask the salesperson to adjust and re-tune the guitar. After the retune try the guitar again, if the problem persists, don't get it! The most important thing when buying a guitar is to judge each one by feel, sound and appeal.
9) Buying the Guitar - When you've finally settled on a guitar you like and you feel completely happy. Make sure you ask for a warranty, some new strings, a gig bag and a tuner. If you're new to the guitar you won't have any of these, so it will be a good investment. It is worth considering that most dealers leave the factory strings on their guitars, a new set of strings will brighten up their sound instantly.
10) Start Learning! - Now you've got the guitar you want plunge head first into learning the basics, whether from a private tuition, books or even Youtube videos. The more you practice the better you will get, as with anything worth doing.