It is usually a word or a phrase that one repeats silently in the mind. The mind is forced to have one thought, the mantra. Since the mind can only think one thought at a time, if it thinks the mantra it cannot think anything else.
The mantra is usually a powerful spiritual word or phrase. In that way the mind not only repeats the mantra but it experiences the power and insight hidden within the mantra. Some revelations from a mantra come quickly, after only a few hours of saying the mantra, but others may take days, weeks, years, or a lifetime of meditation to be revealed.
Some examples of mantras are the following:
Counting of sheep - Here the mantra is not very spiritual, at least not for humans. but it does stop the mind from thinking and worrying, so one can more easily fall asleep.
Sounds - Om is sound and it is a name of God. Also it is usually said not silently but aloud, in concert with deep breathing.
Common Mantras - there are many, but here are a few: Jesus; God is love; I and the Father are One; There is only God; The Lord is my Shepherd; The Way; Eternal life; Mindfulness; Constantly without desire; Be here now; I am whole; Breathe; Let go; Who am I; Maranatha; All Shall be Well; I am Calm and Peaceful; God Almighty; God Redeemer; God Everlasting; Father God; God; Amen.
Long Mantras - There is no law that says a mantra must be short. It can be any length we wish. All we have to do is memorize it and be able to recite it silently. Biblical scriptures are examples, with the Lord's Prayer being perhaps the perfect meditation mantra (see Meditation Scriptures, Matthew 6:9).