I know at the end of Ramayana, Lord Rama and Lakshmana separated. But what is the reason for that?
The story is told in this excerpt from the Uttara Kanda of the Ramayana. A mysterious sage once came to Ayodhya, claiming to be "the messenger of the great saint Atibala" and wanting to talk to Rama. Rama agreed to talk to him, but the sage said that the matter they had to discuss was extremely confidential:
If dost thou wish to bring about the well-being of the celestials, my earnest desire is that we may talk over it in a solitary place. And if thou hast any regard for the words of [Atibala] that foremost of ascetics, do thou so order that whoever shall hear or see us, when we shall converse in a solitary place, shall be slain by thee.
Rama agreed, posting Lakshmana outside the palace gate and telling him "When I shall talk with this ascetic in this solitary room whoever, shall hear or see us, shall be slain by me."
Then Rama and the sage went into a room to talk, and the sage revealed himself to be Yama the god of death. And he delivered to Rama a message from Brahma saying that Rama's time on earth was over:
Thou didst use to protect the deities whenever they were assailed by any calamity. O lord of the universe, it is for that reason, on beholding the destruction of creatures thou wert born on earth to slay the Ten-necked demon. And at that time thou didst promise that thou wouldst live in the land of mortals for eleven thousand years. Thereupon thou didst assume a human form to carry out thine desire. Now that period is ripe and this is the proper time to inform thee of it. O great king, do thou wait in this land of mortals if dost thou wish to govern people for some time more. And if dost thou wish to repair to the region of immortals, do thou again lord over the deities in thy Vishnu form and let them be freed from anxiety.
Rama then agreed to depart the earth soon, for the welfare of the gods. Meanwhile, the famously short-tempered sage Durvasa suddenly came to the palace gate, wishing to see Rama because it was time to break a long fast. Lakshmana stopped him, saying that Rama was busy at the moment, but the Durvasa would hear none of it. He said this:
O Saumitri, if dost thou not go even this very moment and communicate unto Rama my arrival, I shall [curse] thee, Rama, Bharata, Shatrughna, your sons and grand-sons. I shall curse also thy kingdom and cities. I cannot any longer restrain my growing ire.
So Lakshmana was left with no choice but to go into the room and tell Rama that Durvasa was there to see him.
Rama was now left with a thorny dilemma: he had issued an order that he would kill anyone who came into the room, and the kings of Ikshvaku always live up to their word, and yet now he had to carry out the order against his own brother. He consulted his advisers, and then he reached the decision that the only way to spare Lakshmana's life would be to disown him:
O Lakshmana, it is not proper to act against morality, I do therefore renounce thee; for the pious hold that destruction and renounciation are all the same.
Distraught by this, Lakshmana immediately left Ayodhya and went to the Sarayu river, where he ended his life by engaging in meditation and stopping his breathing.
And in case you're wondering, after Lakshmana's death, Rama resolved to depart the earth, and he along with his brothers Bharata and Shatrughna and many Vanaras including Sugriva (as I discuss here), all went into the Sarayu river.
You can't call it a separation. Rama abandons Lakshmana. He says abandoning good people is as good as killing them.
विसर्जये त्वां सौमित्रे मा भूद् धर्मविपर्ययः ।
त्यागो वधो वा विहितः साधूनां ह्युभयं समम् ॥ १३ ॥
Story: While Rama is having a secret meeting with Devatas, for it to be uninterrupted, he gives this responsibility to Lakshmana. If he fails he was to be killed. But due to Durvasa's entry Lakshmana could not keep his responsibility. So Rama in great grieve says that he has abandoned him. Lakshmana goes to Sarayu river doing achamana, he holds his breath and ends his avatara.