I've always thought that 「横」 in 「横になる」 only refers to the fact that you're lying as opposed to standing (so you're now horizontal from the point of view of a standing person), regardless of your exact position. But when I search for 「横になる」 in Google Images I mainly get pictures of people lying on their side. Does the expression imply that position? Can I 「横になる」 on my back, on my stomach, or in some other way?
Originally it just means "to lie down" or "to sleep". This you can see e.g. based on an example sentence given for one of the definitions for「横」on『新明解国語辞典第五版』：
- 水平の方向（の長さ）。 「―になる〔＝寝る（時と同じ姿勢をとる）〕」
❺ 物の置かれた形が、水平に長く伸びていること。 「ソファーで━になる」
In this context「横」should then be interpreted as an antonym to「縦」, i.e. as lying down (horizontal) vs standing (vertical). So yes, you can「横になる」on your back or on your stomach, although you would tend to prefer to use the word「寝る」if you want to specify the position like this (i.e. you would probably want to avoid saying「仰向けに横になる」, although a quick google search does return some results for this type of usage as well).
However, I feel some may use it to denote "lying on one's side" in particular. Especially if the context is a discussion about sleeping posture (and it is implied that the person is already in bed), then it would almost certainly be used exclusively in that sense, as opposed to「仰向けになる（/寝る）」and「うつ伏せになる（/寝る）」. These google search results demonstrate this type of usage; one example would be「寝るときに横になると息が苦しくなり(...)」. Still, even then, using「横向きになる（/寝る）」is usually preferable, as it is less ambiguous in meaning.