It depends.
If your computer came with a mount to mount it on the stem that's my preference. Leaves more of my handlebars free to rest my hands on. In fact, I bought a whole new speedometer just so I could mount it on my stem.
If you computer didn't come with a stem mount you just have to mount in on the handlebars. I guess you could mount it on the stem, but then it would be sideways.
I've also seen people mount it on the top tube right by the handlebars - it's harder to see while you're riding, but not that different and it's off the handlebars. I didn't do that just because that's where my bike light battery mounts.