1) I was sure that you would give me a telegram when you COME to Moscow.
2) I was sure that she would go to the museum again as soon as she HAD the spare time. [samples]
Let's turn these around for a minute [it's simpler to see]:
1) When you come to Moscow, I was sure you would send me a telegram.
[That does not follow the rule for tenses. The ideas must refer to the present or the past, not both times.]
That when is like an IF (first and second conditional), therefore, we get:
When you come to Moscow, I am sure you will send me a telegram.
present after when, or, in the past
When you came to Moscow, I was sure you would send me a telegram.
2) I was sure that she would go to the museum again as soon as she HAD the spare time.
As soon as she had spare time, I was sure she would go to the museum.
That is correct. The entire sentence is in the past.
Compare that to:
As soon as she has spare time, I am sure she will go to the museum.
The overall usage is that either you put an idea in the present and will goes in the main clause, or you put the idea in the past, and would + verb goes in the second clause. Bear in mind that the would in those sentences is the past tense of will.
In these examples, I'd tend to use contractions. you'll and you'd, for example.