Your sleep quality is the pivotal issue, because if you quality is fair or poor, it means that your sleep is disrupted or fragmented much of the night. And, when you suffer from sleep fragmentation, remarkably, it will cause then to sleep too much or too little. In other words, if you're prone to insomnia for example because you suffer from some anxiety, then a sleep quality problem often results in your sleeping for less hours than you desire. If you don't suffer from any anxiety or insomnia, then a sleep quality problem often results in your sleeping more hours than you would like to be sleeping or routinely wanting or needing to nap during the day.
In sum, even though the term insomnia often implies a problem with the number of hours of sleep you're not getting, the term would be more correctly used by connecting insomnia to a sleep quality problem.