The statute of limitations for legal malpractice begins to run when you when you are harmed by malpractice or first learned of the harm (or could have learned of the harm through the exercise of "reasonable diligence"). However, there are two significant exceptions to that rule: (1) if that same attorney continues to represent you after the incident or event constituting the malpractice, the statute does not begin to run until the attorney's representation of you concludes; or (2) if the attorney actively takes steps to conceal his malpractice from you, the statute does not run until you learn of the concealment.
The question of when the "harm" occurs is something that people often ask about. The harm occurs when your rights are adversely affected. So, for example, if an attorney conducting a trial failed to call an expert witness, and if that failure resulted in the case being dismissed, the "clock" for statute of limitations purposes would not start to run until the dismissal (unless, of course, the attorney continued to represent you beyond the dismissal or somehow concealed the dismissal from you.