I was improvising on my piano, when I played a two notes simultaneously where one of the notes in it was longer than the other. I liked it, and wanted to implement it in the sheet music I write; The problem is, I don't know the notation for it. What is the notation for a double stop where both notes in the double stop are different lengths?
This is common notation in keyboard music, although we don't call them "double stops"; it's just harmony. When notating something like this, you write the music out as different voices, with the caveat that up-stem and down-stem notes help clarify which voice is which.
Consider the following example: the up-stem pitches are one voice and the down-stem half notes are a separate voice. (Notice also that even the tie upwards.) This notation clearly allows us to separate which pitches belong to which melodic line.
But it becomes more difficult when there are intervals of a second involved; we have to off-set one of the notes to distinguish the noteheads. (See also What does it mean when two notes are stuck together?)
Contrast this with the abyssmal notation shown here that doesn't clarify stem direction or the interval of a second; yikes! It's impossible to know that the opening G in the lower voice should last the entire opening quarter note, and beats 2 and 4 are an outright mess.
Lastly, when you have more than two voices, we combine the different stem directions with some slight horizontal spacing to distinguish the voices from each other. In the following example, note that the middle voice is slightly pushed to the right to prevent it from colliding with other noteheads and stems.