As a commenter under the question points out, you also omitted the verb in the relative clause in each case. This results in grammatical sentences but, out of context, may not be interpreted as meaning the same.
Imagine a context in which you are pointing to a photograph of the boy:
This is the boy who was at the party yesterday: i.e. Here is a picture
of the boy. He was at the party yesterday.
This is the boy at the party yesterday: i.e. Here is a picture of the boy (having a great time) at the
party yesterday.
Similarly:
Context: Pointing to a picture of the same bike on Amazon.
Statement: This is the bike which was in the shop window.
Interpretation: This bike was in the shop window yesterday (but it may or may not still be in the window now).
Context: Pointing to a picture of the bike in the window.
Statement: This is the bike in the shop window.
Interpretation: This is a picture I took of the bike (that I saw in the shop window yesterday).
Unlike in grammar resources, all utterances in real-life occur in a ontext that determines their interpretation.