Generally it applies to both. But some crimes (eg murder) might not have a statute of limitations.
https://www.law.cornell.edu/wex/statute_of_limitations
Also there are subtle questions around what discovery means here. Usually it is some sort of "could be discovered with reasonable effort". If I had proof of your wrongdoing in a letter sent to me, I am unlikely to get away with saying, "Oh, I didn't read the letter when I got it." If that proof was buried in a computer file with a million pages, I probably can reasonably say, "That was a needle in a haystack, and I didn't even know what to look for." For situations between those extremes, there will be case law that likely varies by state.
This is where a lawyer gets to earn their pay.