The saying “don’t look a gift horse in the mouth” means that you shouldn’t criticize a gift, even if you don’t like it very much. A gift horse, in other words, is a gift.
The term gift horse is pretty easy to remember if you imagine the horse as a present. The idiom itself probably stems from the practice of determining a horse’s age from looking at its teeth. It would be rude to receive a horse for your birthday and immediately examine its mouth in front of the person who gave it to you, as if you were trying to figure out the value of your gift.