How long did Luke know Ben/Obi Wan?
According to the new, canonical webcomic, Ben saved Luke from a Krayt Dragon attack when Luke was 13 years old. As you might expect, Uncle Owen was less than enthusiastic about Ben getting involved in Luke's life, despite the fact that the boy would have died if not for Ben's intervention.
It appears that the two didn't meet again until Luke was 19, when R2-D2 ran off to find Obi Wan, Luke and C-3PO chased after him, and Luke was attacked by Sand People. We all know that story already...1
Lucasfilm has said the comic is indeed canon:
Back in June, Coffee with Kenobi was able to talk to a Lucasfilm representative about the Korean webtoon, confirming the studio’s collaboration with Hong Jac-Ga and the legitimacy of the new story. They said that “the story being told is part of canon and will explore Episodes IV, V and VI through its 10-month run that concludes January 2016. ‘Yes, the Lucasfilm publishing team and Story Group were involved in the development and worked closely with’ Hong Jac-ga, Lucasfilm said.”
Why did Luke seem to grieve more for Obi Wan than he did for Owen and Beru?
Borrowed from my answer to this question: What upset Luke more: the death of his family or the death of Kenobi?
We don't know which deaths affected Luke more.
However, as to your suggestion that Luke seems to be more upset about Obi Wan's death, I think there are a few possible explanations:
Luke saw the mission to save Leia as a way to avenge Owen and Beru. Being able to do something makes the grief more bearable: "Those imperial scum killed my family - let's get 'em!" Contrast this with "That Vader bastard killed Obi Wan - RUN AWAY!"
In a similar way, rescuing Leia and learning about the Force on the way gave Luke something to keep himself occupied. He had less time to dwell on the past. After it was over, he was finally able to absorb and process everything that had happened over the past week or two. This is when the deaths of Owen and Beru finally sunk in. His bereavement at this point is about Obi Wan and Beru and Owen.
When Owen and Beru were killed, Luke still had a tie to his former life - Obi Wan, who knew him, his dad, and his aunt and uncle, and who had been (unbeknownst to Luke) watching over him his whole life. After Obi Wan died, Luke was totally alone, with no ties to his former life, which must have been crushing. Luke's link to Tatooine was totally severed. He was on his own, and he had no idea what to do next. The future was a complete unknown.
We don't see every moment of every day, and much of Luke's grieving may have taken place off camera. The movie would be less enjoyable if it consisted of scene after scene of Luke moping. He's already whiny enough, any more griping and moaning - however understandable it might be - would run the risk of making Luke an unlikable protagonist.
1Prior to the recent retcons, it appeared that only a few days had passed between Ben rescuing Luke from the Sand People and his death at the hands of Vader. However, we have no reason to believe that this was the first time Luke met Obi Wan - after all, when Luke regained consciousness after the Sand People attacked, he recognized Kenobi on sight.