Donald J. Trump's apparent endorsement on July 27 of Russian cyberspying against Hillary Clinton has pulled President Vladimir V. Putin fully into the American political fray. But Mr. Putin's relationship with Mrs. Clinton has been tense at least since 2011, when, as secretary of state, she accused him of rigging an election and he accused her of meddling in Russian politics.