Immersion is not valid until the seven clean days have been completed.
If the woman realizes her error before she has relations with her husband, she just needs to count her 7th clean day and immerse. If she has already had intercourse with her husband, she needs to wait four days (the day of relations is the first of those four days) while continuing to perform bedikot daily, count her 7th clean day, and immerse. (Keep in mind that if relations took place at night, that night and the following day are day 1, the day after that is day 2, etc.)
If she only realizes after some time has passed, and more than five days have elapsed since her last bedikah, she needs to restart her clean days. She needs to wait four days from the last time she had intercourse, and then count a new seven clean days.
Please feel free to get back to us with any further questions.