What did giraffes evolve from?
Did they evolve from and animal with a short neck and then grew a longer neck?
Did they evolve from a horse?
What's a giraffes closest relative?

Giraffes are artiodacyls -- even-toed ungulates -- which means they are related to other artiodactyls like deer and cows. Their closest relative is the okapi, which is roughly horse-like in proportion: in particular, its neck is no longer than that of a horse the same size. But giraffids (giraffes and okapis) are not at all closely related to horses, which are perissodactyls (odd-toes ungulates), related to rhinos and tapirs.

Yes, giraffes evolved from shorter-necked animals. The specific reason why their necks are so much longer than those of their ancestors and contemporaries is still much debated. There are three main theories. One is increased browsing reach; another is that long necks appear sexy to other giraffes, so help them to reproduce; a third is that giraffe are really selecting for long legs, not necks, but that the necks have to grow long enough to let them reach the ground.