There is no definite story about when Rakshabandhan started, but as written in the Bhavishya Purana, Lord Indra's wife first tied the Raksha Sutra by chanting some special mantras. Devraj Indra with a rakhi of mantras fought the battle with the Asuras and Devasur. With the power of this sutra, Devaraj Indra won this battle.
At the time of the killing of Shishupala, Lord Shri Krishna's finger was cut off by the Sudarshan Chakra, when Draupadi tore her saree off and tied it on Sri Krishna's finger. This day was the date of Sawan Purnima. Lord Krishna promised Draupadi that when the time comes, he will repay the debt of each yarn of her help with saree. Sri Krishna kept this promise at the time of disrespect of Draupadi by the Kauravas.
The story of Rajput queen Karnavati is quite prevalent in modern times. The Rajput queen sent a rakhi to the Mughal ruler Humayun to protect her kingdom. Humayun accepted Karnavati as a sister and saved her kingdom from the attack of the enemy.