1. I stopped going outside when I caught a bad cold.

2. I stopped having gone outside when I caught a bad cold.
3. I stopped having gone outside.

Can we use #2 or #3? When can we use the sturcture of "stop having p.p."?

No. #s 2 and 3 are incorrect.

You could say any of these ~

I didn't go outside when I had a bad cold.
I stayed inside when I had a bad cold.
I stayed in my house when I had a bad cold.
I stayed in bed when I had a bad cold.

I can't think of any time when we can use that structure.

You could say ~

I stopped having my garden taken care of by others.
I stopped having my hair dyed.
I stopped having ~~> needs a noun next as direct object, then a past participle after that.

Out of the three sentences you provided, only sentence #1 is grammatically correct and commonly used. Let's break down the usage of each sentence:

1. "I stopped going outside when I caught a bad cold."
This sentence is correct and widely used. It indicates that the person stopped going outside because they caught a bad cold. The clause "when I caught a bad cold" provides the reason for stopping the action of going outside.

2. "I stopped having gone outside when I caught a bad cold."
This sentence is not grammatically correct and is not commonly used. The phrase "having gone outside" is in the present perfect tense, which is not appropriate in this context. The correct form would be "I stopped going outside" or "I had stopped going outside."

3. "I stopped having gone outside."
This sentence, as it stands, is not completely clear and is not commonly used. It lacks a clear reason or context for stopping the action of going outside. By itself, this sentence does not convey a specific meaning. However, it could potentially be used in a longer sentence with additional context.

Generally, the structure "stop + having + past participle" is not commonly used. The more commonly used structure is "stop + present participle" (e.g., "stop going," "stop eating," "stop working"). This form is used to indicate the cessation of an ongoing action in the present or the past.