The story of division of Yajurveda is mentioned in this chapter of Vishnu Purana. Once Vaiśampáyana accidentally killed his sister's child and so all his disciples to perform the expiatory penance but Yájnawalkya refused to do so. On this, Vaiśampáyana commanded him to return all his knowledge learned from him. So, Yájnawalkya ejected it from his stomach. This Shakha is called as Taittiríya or Krishna-Yajurveda.
It had been formerly agreed by the Munis, that any one of them who, at a certain time, did not join an assembly held on mount Meru should incur the guilt of killing a Brahman, within a period of seven nights 2. Vaiśampáyana alone failed to keep the appointment, and consequently killed, by an accidental kick with his foot, the child of his sister. He then addressed his scholars, and desired them to perform the penance expiatory of Brahmanicide on his behalf. Without any hesitation Yájnawalkya refused, and said, "How shall I engage in penance with these miserable and inefficient Brahmans?" On which his Guru, being incensed, commanded him to relinquish all that he had learnt from him. "You speak contemptuously," he observed, "of these young Brahmans, but of what use is a disciple who disobeys my commands?" "I spoke," replied Yájnawalkya, "in perfect faith; but as to what I have read from you, I have had enough: it is no more than this--" (acting as if he would eject it from his stomach); when he brought up the texts of the Yajush in substance stained with blood. He then departed. The other scholars of Vaiśampáyana, transforming themselves to partridges (Tittiri), picked up the texts which he had disgorged, and which from that circumstance were called Taittiríya; and the disciples were called the Charaka professors of the Yajush, from Charańa, 'going through' or 'performing' the expiatory rites enjoined by their master.
Then Yájnawalkya did a penance to Lord Surya (sun) and learned Shukla Yajurveda from him.
Thus eulogized by Yájnawalkya, the sun, in the form of a horse, appeared to him, and said, "Demand what you desire." To which the sage, having prostrated himself before the lord of day, replied, "Give me a knowledge of those texts of the Yajush with which even my preceptor is unacquainted." Accordingly the sun imparted to him the texts of the Yajush called Ayátayáma (unstudied), which were unknown to Vaiśampáyana: and because these were revealed by the sun in the form of a horse, the Brahmans who study this portion of the Yajush are called Vájis (horses). Fifteen branches of this school sprang from Kańwa and other pupils of Yájnawalkya.
This story is also mentioned in Srimad Bhagavatam 12.6 (verse 62-74) where division of Vedas are discussed.