If it were my friend talking, and I had been the former guest, I might reply with one of these:
- I have stayed there before.
- I once stayed there for three weeks.
But I don’t think I’d say what you said:
- I have stayed there for three weeks.
I’m trying to think of a situation where I might say something close to that – the best I’ve thought of is when I’ve stayed at the hotel multiple times, but my longest visit was three weeks. In that case, the conversation might go something like this:
F: I’m thinking about staying at the Waterfront Hotel in Miami.
M: Oh, really? I’ve stayed there before!
F: You have? How long did you stay?
M: Usually I only stay for a few days. But I have stayed there for as long as three weeks.
That’s me trying to force the have stayed there for three weeks phrasing and keep it sounding natural. Even then, I had to add the as long as part to make it work. I think a more likely reply would be:
M: My longest stay was three weeks.
although I might say:
M: So far, my longest stay has been three weeks.
if I still go to Miami on occasion, I still frequent the Waterfront Hotel when I’m there, and I have been toying with the idea of an even longer stay at some time in the future.
I don’t have a simple grammatical rule that explains my preferences, but as StoneyB’s canonical post says:
There is no hard-and-fast rule. The choice of a perfect to introduce a prior eventuality, like the interpretation of a perfect, depends on context—not just the nature of the eventuality introduced, but the reason it is introduced and the temporal context into which it is introduced. So the fact that a perfect is used in particular circumstances cannot be generalized to a rule that it should be used in those circumstances.