Can I be gay as long as I don't have sex?
That's really the wrong question.
Many Christians will tell you that it's OK to be gay as long as you don't "act out" -- by which they mean "have gay sex". This is a misunderstanding.
God is not a score-keeper. He is not watching to see if you "act out" so he can cross you out of the Book of Life. The Christian life is much more alive than that. Homosexuality is just one symptom of the disease of sin. Everyone is as sinful as everyone else. It's not about being as good as possible. Of course God doesn't want you to sin, but what you do or don't do is not the measure of sin.
Jesus famously said that every time you look with lust upon another, you have committed adultery with him or her. He called the Pharisees sinners every chance he got, and they followed the strict Law of conduct perfectly.
But their hearts were wrong.
All of our hearts are wrong until we allow God to move in and fix them up.
So, instead of asking "how far can I go?" ask "how close can I get to God?" That's what matters. The closer you get to Him, the more you will adhere to His Word -- out of love and not blind obedience!
If you believe that it's wrong to be gay, then abstaining from sex doesn't make it any more right. Of course, every unmarried person should abstain from sex. It doesn't matter what your orientation is.
So, obviously don't have sex! But don't stop there. If you want to be free from homosexuality, pursue God with everything you've got. He will be faithful to make you into who He wishes you to be. And it will not involve lust or misdirected passion.