When somebody says this idiom to you they usually mean that you are one of a kind, unique, and an incredibly special kind of person. There is nobody else like you, because after you were created the mould that you came out of was broken to make sure that no more yous could be made. (Think moulds in a factory mass-producing something. In American English it is spelled mold.)
So the meaning is often positive and may be used in a romantic situation or to flatter somebody by telling them how great they are. However, it can also have a negative meaning due to the ambiguity of the word when. If when means ‘while’ or ‘at the time of’ making you, then the meaning is positive, but if when means ‘after’ making you, the meaning is negative, e.g. ‘they broke the mould deliberately so that no more yous could be created – because I/we don’t like you.’
We can also use this idiom sarcastically, when somebody makes a trivial mistake or says something a bit silly, to point out that we think they are original or unusual – not run-of-the-mill. Not normal.
It’s rather an old-fashioned idiom, so we might expect an older person to use it. It may be used as a quite corny chat-up line. A bit like this line: ‘Are you sure you aren’t tired?’ ‘Why? ‘Because you’ve been running through my mind all day!’
On a first date:
Jemima: I’m so glad you invited me to this party.
Alan: I’m so happy you said yes! You know, Jemima – they broke the mould when they made you!
Jemima: Oh don’t be silly. (Pause) Really?
Frida: My boss has been on my back all morning about the Jensen account. What a dork!
Olga: He’s always on your case! What an odd guy he is. Sad, really. You know, they really broke the mould when they made him.
Frida: I hope they did!
Tom: I’ve just realised that today is Wednesday, not Tuesday! I’ve spent all day thinking it was Tuesday! What an idiot!
Ida: What are you like! You know, they really broke the mould when they made you!