Today we’ll be talking about WHEN and WHERE used as relative pronouns. They are used in less formal language to replace the pronoun WHICH preceded by a preposition if the antecedent relates to time or location. Both WHEN and WHERE are only used in restrictive clauses.
So, let’s have a look at the more formal forms used with the pronoun WHICH and a preposition.
Time
First an examples with an antecedent relating to time.

It was the day ON WHICH they got married.
This sounds pretty formal. In less formal language we could say:
It was the day WHEN they got married.
Here are some more examples with WHEN used in this sense:

There was a time WHEN we liked each other.
I’m looking forward to a night WHEN I will be able to sleep for more than a couple hours.
The day WHEN I met you was one of the best days in my life.
Location
In a similar way we use WHERE if the antecedent is related to location. In more formal language we use WHICH with a preposition. Here’s a rather formal example:

The city IN WHICH I live is beautiful.
In less formal context we would say:
The city WHERE I live is beautiful.
And here are some more examples with WHERE.

The lake WHERE we were swimming is pretty deep.
The country WHERE she was born doesn’t exist anymore.
The forest WHERE this happened is very big.