The H4 visa is valid as long the H visa holder’s visa it is connected to, is valid for.