The Torah level obligation to cover the hair is limited to a married woman. But the rabbinic obligation extends to all Jewish women who have ever been married. Therefore, widows and divorcees should cover their hair, except in cases or situations where hair covering would serve as an obstacle to the woman's eventual remarriage or to her livelihood. Non-virgins who have never been married do not need to cover their hair.
A woman who has a child but has never been married is not required to cover her hair.