What is the proper time to do the hefsek tahara?
The hefsek tahara must be done before shkia (sunset—see myzmanim.com for times in each location). If for some reason one was delayed and only did it after shkia, she should consult a Rabbi if it is valid depending on her specific situation.
It is recommended to do the hefsek tahara an hour before shkia. This gives ample time to try a second time if the first one wasn’t good, and will avoid last minute rushing to complete it before shkia. If it is difficult to do it then (she won’t be home or in another place that she can do it comfortably), it may be done from the time of mincha ketana—approxamitly 2 hours before shkia. If even that is difficult, it may be done at any earlier time in the day.
See Shulchan Aruch and other poskim Y.D. 196:1