- 你在北京玩儿得高兴吗？ Why is 得 used instead of 很?
"得" is the adverb marker in this sentence. 玩儿得高兴 literally "play happily".
Some other examples of the V+得 structure:
走得快 to walk fast
吃得小心 to eat carefully
很 can be added before the adjective to increase the degree of the adjective.
走得很快 to walk very fast
吃得很小心 to eat very carefully
In your example the tense is probably past, as in "Did you have a good time in Beijing?" It can also be present, if you are, for example, talking on the phone. "Are you having a good time in Beijing?"
- Can I just say 你在北京玩儿了吗？
Yes, you can. It means "Did you travel for leisure in Beijing?" Literally, "Did you play in Beijing?"
- Do I need 了 in this sentence?
It depends on what you want to say.
"你在北京玩儿吗？" Are you having a leisure trip in Beijing? sounds like you're asking this question on the phone or via any instant communication device. The addition of "了" indicates that you are asking about a past action.