So my friend told me this:
温室で死ぬ時が来た
I understand that the translation means "It's time to die in the greenhouse", but I don't understand the 「死ぬ時」 part of the sentence.
What kind of structure is this?
This is a relative clause. You might translate it as "The time has come, where (I) die in the greenhouse" or "The time to [die in the greenhouse] has come".
It's split up the following way:
温室で死ぬ - die in the greenhouse
時が来た - time has come
Literally "Die-in-the-greenhouse time has come".
English has signal words that introduce a relative clause, whereas Japanese does not. It's just a normal sentence directly in front of a noun.