So insomnia can be classified into two different types of insomnia - acute versus chronic.
Acute insomnia is when you have a known triggering factor and your insomnia lasts for less than a month. When your insomnia lasts for more than a month, it's then called chronic insomnia.
Chronic insomnia can be further classified into adjustment insomnia, which is, there's a known triggering factor, it's lasting a little bit longer than one month. Psychophysiological insomnia, where the person is left with behaviors or sleep habits that further perpetuate their insomnia. Paradoxical insomnia, when a person may be sleeping a lot more than they think. Insomnia due to mental disorders, which is usually anxiety or depression. And insomnia due to medical disorders, such as diabetes, thyroid problems, hypertension. You can also have insomnia due to inadequate sleep hygiene. Many people don't practice good sleep habits, and that will lead to insomnia at night.
Chronic insomnia can also be called primary insomnia versus secondary insomnia. Primary insomnia is when you cannot trace your insomnia back to any definitive cause. Secondary insomnia is when you have a direct cause, such as a medical disorder or a mental disorder leading to insomnia.
So those are the different types of insomnia and an extensive history is needed to determine what type of insomnia that you may have.