Actually, a day ago, a friend asked me how I knew I didn't have a vocation - which I understood as nearly the same question as, 'How do you know if you have a vocation?'
I don't know.
However, I explained that I only knew with time, and only after searching and trying out a couple of religious orders: Discalced Carmelites, Little Brothers of Jesus, Trappists, Carthusians. Initially, on my first retreat after my conversion, I asked our Lord out loud, "Do I have a vocation to religious life/priesthood, Lord?" I heard a distinct interior voice say "No." So I proceeded to try my vocation in the above named orders, and went back and forth for several years wondering, Should I go? Should I stay? Do I have a vocation? Or not? I wonder if the Lord was standing there talking through his teeth, "I already told you..." But that isn't how it works - the process, the attempts - it's all part of it.
Anyway, as time went on, I knew I could never stick it out anywhere beyond a couple of years. When I was 'in' the monastery, I loved it, but I couldn't settle down - which is my natural explanation why I tried the Benedict Joseph Labre thing - which only made me long for the security of the monastery again. That said, supernaturally, the entire experience had been a novitiate for my life, a training in the spiritual life and prayer. Sort of special-ed for me to know how to be normal and live an ordinary life - because I had never known what normal was, or what ordinary life meant.
It appears my voice was right the first time - but I had to go through all the attempts to find that out. In retrospect, the Lord saved the Church from me, he preserved the religious houses I tried out from me: And countless souls may have been saved because I stayed out of the monastery... horrible scandals were averted. I exaggerate perhaps - maybe not. Other people may think I had a vocation but lost it. They are wrong of course. Like Benedict Joseph Labre, I never had the temperament for it. I really do know that now.
That said, I don't really know how one discerns a vocation. It seems to me a vocation happens - like falling in love. But I'm a romantic. Some people just seem to be able to make a decision and stick to it.