I’ll start by saying, as always, that the answer depends. In this case, it depends not just on state law, as is usually the answer, but also on what method you choose to remedy the problem. For example, if you decide not to pursue any course of action against anyone and just fix the problem at your own expense, then you can take as long as you want to fix it.
Presuming this isn’t the answer you’re looking for, let’s turn to the next place duped buyers often look for recourse: the home warranty. The home warranty is not usually something that comes in a sales contract or an insurance form (though you can usually find such language in both those places), but rather is a statutory guarantee. Almost all states have some sort of home warranty law by which the builder of the home guarantees certain things about the home (usually just structural soundness) for a certain period of time. Since home warranties are statutory protections, what protection you have under them and how long you have to invoke that protection varies from state to state.
Having said that, there are a few generalizations that can be made about home warranties. First, note that I said home warranty statutes require that the builder make some guarantee. That means that home warranties usually only apply to new construction homes. Second, home warranties are almost exclusively for structural defects. If your foundation cracks, you’re covered; if you’re not on a city sewer system, well, you might not be covered. Third, and most to the point of what you were asking, most home warranties have a very short time frame in which they are effective – usually one year. In short, you only need to worry about the time limits (called statute of limitations) on a home warranty if you have purchased your home from a builder and there is a structural defect, and even then, you better act fast.
There are other avenues to pursue if the protection under a home warranty statute is unavailable to you. For instance, the defect you describe – the misidentification of utilties – sounds like a title defect. Title defects are covered by title insurance, and there is no time limit to seek satisfaction under this particular type of insurance policy. There are also, under the right circumstances, disclosure or fraud statutes under which you could seek redress against the home builder, the home seller or the previous homeowner. All of these claims have prescribed statutes of limitation that may vary from state to state (though most have probably run after six to 10 years).
If you discover a non-disclosed defect after purchasing a house, the first place to turn is your title insurer. This is the least costly, and most likely, way to get your problems addressed. If the defect is not covered under title insurance, contact a lawyer (your title insurer can probably put you in contact with one) as all the other means of addressing the problem can be highly legalistic, and you may lose your rights if you wait too long to act.