I just want to know how long does this feeling of loneliness go on for
I don't know. It lasts as long as it lasts. What you need to be careful of, however, is allowing your loneliness to influence your decision making.
In my case, I haven't been with anyone for over 3 years. It's a personal choice, one that is best for me. And what I've learned how to do over those 3 years is become very, very independent. When we have holes in our makeup, other people can't fill them for us. We have to fill them ourselves. For me, it was incredibly important to finish graduate school, reclaim my career, grow as a musician/guitarist, and nurture other relationships. I've done all these things, and for the most part, I'm pretty content.
When you want to date again, Karrets, do it for the right reasons. Make sure you have something to give the other person that means something. And be able to receive what he gives you in return.