I am posting some excerpts from Swami Swahananda's writings on mantra that will answer your question. Mantra Japa is used to purify one's mind. Only in a pure mind devotion to God dawns. Devotion to God is a way to God realization. If you are interested in self realization (i.e. Jnana), then also the purification of the heart due to mantra japa will be helpful.
Japa should be performed a prescribed number of times. Angirasa says
that japa repeated without keeping track of the number is fruitless.
The Kularnava Tantra says that if the prescribed number of japa is not
done, the japa does not bear fruit. The Vishvasara Tantra also
supports this view.....
The Tantras especially put much stress on
ritualistic japa. According to the Kularnava Tantra the number of japa
may be counted on the joints of the fingers or on a rosary. Various
rules are prescribed regarding japa and the choice of the rosary...
Japa is to be performed neither very slowly nor rapidly but at an even
rate, moving from one head to another on the rosary. If the japa is
done imperfectly, then this can be rectified by various prescribed
means or by more japa. The devotional schools have always tried to
lessen the rigidity of these prescriptions about japa, placing
emphasis instead on developing a devotional attitude with the help of
japa. They claim that through japa alone even the external signs of
devotion can be manifested. The Vira Tantra says that japa alone can
bring success. It may be done with or without meditation.........
Regularity in the practice of Japa has been highly extolled. .....
Other helpful factors are a secluded place, a suitable seat, and
proper articulation of the mantra. Alertness, of course, is essential.
Tantrasrah speaks of twelve practices which help in the
fruition of japa. Some are austerities, such as sleeping on the
ground, continence, taking a vow of silence, taking three ceremonial
baths a day, and giving up activities that distract from the ideal.
Others are observances, such as worship, giving gifts, supplication,
singing to the deity, occasional worship of the deity, as well as
faith in one's preceptor and in the deity. ...
The Kularnava Tantra
considers mauna, keeping the vow of silence, itself as the best form
of japa. Again, the sage Brihaspati has enumerated observances that
contribute to success in japa, restraint of the mind, purity, silence,
reflecting on the meaning of the mantra, freedom from distractions,
and absence of indifference towards the mantra. The Chandogya
Upanishad says, "Reflecting in the mind, one should repeat the mantra
The devotional schools, however, believe that even if the mantra is
repeated without proper pronunciation or knowledge of its meaning, it
will still be efficacious if the devotee is sincere and has intense
devotion. Valmiki is said to have attained realization by repeating
"Mara", reversing the name of Rama, because he was too sinful to
repeat the Lord's name correctly...... But best results can come
through a combination of devotion and understanding..... So japa,
normally speaking, becomes spiritually effective if it is done with
faith and with knowledge of its meaning. Yet, even if an aspirant
lacks these, through japa, faith in the mantra and knowledge of its
meaning will eventually come. The Name of God itself has great power
and is capable of creating devotion even in a stony heart if it is
repeated for some time.