This question has been asked previously on MathOverflow, and answered (by Mariano Suárez-Alvarez). You can follow this link, and I quote his response below.
You'll find details on this point (and precise references) in Cajori's History of mathematical notations, ¶340. He credits Descartes in his La Géometrie for the introduction of x, y and z (and more generally, usefully and interestingly, for the use of the first letters of the alphabet for known quantities and the last letters for the unknown quantities) He notes that Descartes used the notation considerably earlier: the book was published in 1637, yet in 1629 he was already using x as an unknown (although in the same place y is a known quantity...); also, he used the notation in manuscripts dated earlier than the book by years.
It is very, very interesting to read through the description Cajori makes of the many, many other alternatives to the notation of quantities, and as one proceeds along the almost 1000 pages of the two volume book, one can very much appreciate how precious are the notations we so much take for granted!