"Fans are writing and ask all these questions, 'I'm bullied in school... I'm afraid to come out.' They say to me, 'Could Luke be gay?'" the actor said. "I'd say it is meant to be interpreted by the viewer. If you think Luke is gay, of course he is. You should not be ashamed of it. Judge Luke by his character, not by who he loves."
The character doesn't have an in-canon relationship to speak of, though speculation is high that he's somehow The Force Awakens character Rey's father.
Luke had a heterosexual relationship in the Legends universe, but Hamill has said similar things before about the character.
In January he addressed a fan who questioned Luke's sexuality in a hopeful manner on twitter with a similar response. We'll have to wait for Star Wars: Episode VIII to find out for sure whether Luke has had any relationships in the 30 years between Return of the Jedi and The Force Awakens.