I've heard that the Gayatri mantra is actually used to worship the sun, and that the mantra was titled "Gayatri mantra" because the mantra is formed using Gayatri meter (a Vedic meter).
Is that true?
Gayathri is not a mantra. There are classes of mantra called Gayathri which follow a particular meter called Gayathri.
The most popular Gayathri mantra
ॐ भूर्भुव: स्व:
तत्सवितुर्वरेण्यं । भर्गो देवस्य धीमहि, धीयो यो न: प्रचोदयात् ।। happens to be one among the many.
Gayathri Chandus is a format of 24 meters, any mantra set to this chandus is called a Gayathri (and there are many gayathries). The one today understood as Gayathri mantra , is Savithri Mantra (because of the deity Savitr) set in Gayathri Chundas . The Rishi for this mantra is Vishvamithra.
This mantra is specifically meant for Thapas (तपस; the highest of Tantras) as it increases the heat in the body burning up all muck at the physical level.
First you need to know what is translation of Gayatri mantra
ॐ भूर्भुव: स्व: तत्सवितुर्वरेण्यं । भर्गो देवस्य धीमहि, धीयो यो न: प्रचोदयात् ।।
Oh God, the Protector, the basis of all life, Who is self-existent, Who is free from all pains and Whose contact frees the soul from all troubles, Who pervades the Universe and sustains all, the Creator and Energizer of the whole Universe, the Giver of happiness, Who is worthy of acceptance, the most excellent, Who is Pure and the Purifier of all, let us embrace that very God, so that He may direct our mental faculties in the right direction. ( Source:eaglespace.com)
Here is no explicit mention of any god (THIS IS WRONG TAT SAVITUR REFERS TO SAVITAR THE SUN GOD), it refers to supreme god. And as per few believes Surya is also considered as supreme god.
Few translation also accounts it as for a female god too, Durga sometimes. But its like interpenetrating this mantra as per personal believes.
The Gayatri mantra is the most sacred Rigvedic mantra. The Gayatri mantra praises the sun in the form of Lord Brahma in the morning, as Lord Vishnu at noon, and as Lord Shiva in the evening.
Facing east, a devotee repeats this mantra a number of times (usually a fixed number). This mantra is imparted to a young boy at his Yagnopaveet (Upanayana) for initiation into the religious and spiritual order of the Vedas:
Om bhoor bhuvah svah; tat savitur varaynyam; bhargo dayvasya dheemahi; dhiyo yo nah prachoda-yat; Om. (Rig Veda 3.62.10 and Yajur Veda 36.3)
Om (God), bhooh or bhoor (earth, the giver of life), bhuvah (atmosphere, the dispeller of miseries), svah (wealth, the bestower of happiness), tat (that), savitur (creator), varanyam (most worthy, acceptable, and desirable), bhargah or bhargo (personification of knowledge), dayvasya (of divine), dheemahi (meditate), dhiyah or dhiyo (minds, intellects), yah or yo (one who), nah (our), prachoda-yat (inspire, lead).
English Translation of the Gayatri Mantra:
God is the giver of life, the dispeller of miseries, and the bestower of happiness. Let us meditate upon that Creator, the most worthy and acceptable Almighty God. May He inspire and lead our minds and intellects.
REF:The Hindu Mind by Bansi Pandit
Actually there is no explicit Goddess named Gayatri. Gayatri means "which protects one who chants it". The mantra is so powerful such that the mantra itself is worshipped as a Goddess.
Through Gayatri, we worship the almighty (Vishnu or Shiva) by comparing it to the brightness of Sun.
Indian philosophy and myth is a very complex subject. Gayatri mantra may refer to sun, however, sun is nothing but ENERGY! According to Shaivat belief Siva is non expressed universe represented in a symbol of a BINDU and his other half Sakti is the expressed universe. Thus, sun is nothing but Sakti or energy. Hence, its worship in the form of a Gayatri mantra is in essence a prayer of goddess. Ref Madhu Khanna or Shiva Sutras By V. Rav Idea presented is my synthesis.