The word comes from the name of the main character in Don Quixote, a famous book written by Miguel de Cervantes. In the story, Don Quixote is an old man who reads too many chivalric romances and starts believing he's a knight. He goes out on adventures to fight imaginary enemies and rescue damsels in distress, even though it's all in his head.
So, "quixotic" refers to someone who is idealistic, impractical, and often foolishly romantic. Like Don Quixote, they chase after things that are unrealistic and impossible.