The former Celtic League tournament director was appointed by the SRU to replace Phil Anderton, who had moved up to the post of chief executive, in October last year before taking up his post after the autumn Test series.
New SRU chief executive Gordon McKie has wished Grainger well for the future.
He said: "Keith has decided to leave us. We respect his decision and thank him for his contribution to Scottish Rugby.
"We wish Keith all the best in the future. He will remain with us to effect a smooth transition for his successor."