Check out the details. Start with the tag of the hat. All Gucci products should have the word "Gucci" on the tag with the words "Made in Italy" directly under it. The tag should also have a model number which you can find on the back of the label. If your hat doesn't have all of these identifying factors, it's not real Gucci.
Take a look at the stitching. Because Gucci is a luxury product, it's made extremely well. Stitching should be even and neat. You should not see any loose ends or lopsided stitches.
If you're purchasing a logo hat, take a look at the logo to make sure it looks right. The Gucci logo contains two interlocking G's. Some Gucci products are also made with a print that puts two G's next to each other. One is right-side-up and the other is upside down. This pattern doesn't have the G's interlocking. If your logo looks like anything other than these two prints, you have a fake.
Pay attention to price. Gucci hats retail for anywhere between $240 to $450, as of date of publication. It's okay to expect to get a discount sometimes, but if your hat is much, much lower than retail price, it's probably because it's not real. Be smart about your purchase and keep in mind that if you want real Gucci, you're going to have to fork over real money.
Use caution when buying Gucci products on online auction sites. This is a haven for counterfeiters. Make sure that your seller has lots of detailed pictures of the product he is selling. Also, be sure to check his seller rating and consumer feedback. You want to find someone who has a positive selling history and doesn't have any negative buyer comments.
When buying luxury products, the safest way to make sure you're getting the real deal is to buy yours from a Gucci boutique, the Gucci website or a luxury department store.