There are a few different types of dark spots (hyperpigmentation) that can appear on the skin of the forehead and elsewhere on the face.
In women, a common form of hyperpigmentation on the face is called melasma, which occurs when pigment cells proliferate in the skin under the influence of hormones. In addition to the forehead melasma is common on the cheeks. It is usually made worse by pregnancy and sometimes by birth control pills.
Another type of hyperpigmentation on the face would be 'age spots' which tend to occur in middle-aged adults and older and are the result of sun-induced damage to the skin
Postinflammatory hyperpigmentation is a type of darkening of the skin that occurs in healed skin after some form of injury
; it is very common, for example, in areas of prior severe acne.
If the dark spots occur mostly up at the hairline itself, this may be seborrheic dermatitis, especially if there is also itching, scaling, and a certain 'greasy' texture to the spots. Often there is also involvement of the scalp itself.
As their are several possible causes, talking with your dermatologist
or primary care doctor
to determine the cause and whether treatment is needed would be the next step.