Which mantra should I chant for a troubling planet, and how many times?

a simple graha mantra or the deity linked to the planet, chanted daily with steadiness — consistency matters more than huge counts.

Mantra is the most widely recommended remedy because it costs nothing and steadies the mind. Each planet has a short nāma mantra, such as “Om Sūryāya Namaḥ”, “Om Somāya Namaḥ”, “Om Śanaiścarāya Namaḥ”, and also bīja and Vedic mantras. Many people prefer to worship the deity associated with the planet: Sūrya for the Sun, Śiva or Pārvatī for the Moon, Hanumān or Skanda for Mars, Viṣṇu for Mercury, Guru or Dakṣiṇāmūrti for Jupiter, Lakṣmī for Venus, Hanumān or Śani-deva for Saturn, Durgā for Rāhu and Gaṇeśa for Ketu.

A common practice is one mālā (108) daily, often on the planet's weekday. Texts give large totals for formal anuṣṭhāna, but for ordinary devotion, daily sincerity is enough.

Chant with attention and good conduct; a mantra said while cheating others has little value.

Source: Bṛhat Parāśara Horā Śāstra (graha remedies); modern practice · One mālā = 108

Dharma Q&A — Jyotiṣa, scriptures & modern life · Ask a Jyotishi your own question