TITLE: The unit tangent bundle of 2- or 4-manifolds as a principal $S^{1}$- or $S^{3}$-bundle
QUESTION [5 upvotes]: What  type  of obstructions have  been  studied  so that the unit tangent bundle of a Riemannian 2-(4-)manifold have a structure of  a principal $S^{1}$-($S^{3}$-)bundle?

REPLY [2 votes]: Here are some details for the statements in Robert Bryant's answer, mostly as an exercise for myself. A priori the unit tangent bundle of a Riemannian $n$-manifold has structure group $\text{O}(n)$. The questions in the OP can be interpreted to mean the following (if the OP means something else it would be good to clarify):

when $n = 2$ what are the obstructions to reducing the structure group from $\text{O}(2)$ to $\text{SO}(2) \cong S^1$?
when $n = 4$ what are the obstructions to reducing the structure group from $\text{SO}(4)$ to $\text{SU}(2) \cong S^3$?

Presumably the intended map $\text{SU}(2) \to \text{SO}(4)$ comes from the natural action of $\text{SU}(2)$ on itself by, say, left multiplication. Somewhat more explicitly, this map can be written as a composite
$$\text{SU}(2) \xrightarrow{\text{id} \times 1} \text{SU}(2) \times \text{SU}(2) \cong \text{Spin}(4) \to \text{SO}(4) \to \text{O}(4).$$
In the $n = 2$ case reduction of the structure group of the tangent bundle from $\text{O}(n)$ to $\text{SO}(n)$ is one of the several equivalent definitions of orientability, so that's that. 
In the $n = 4$ case, the factoring of the map $\text{SU}(2) \to \text{O}(4)$ above shows that we first need to reduce structure group to $\text{SO}(4)$ (so we need a choice of orientation), then to $\text{Spin}(4)$ (so we need a choice of spin structure). Now, $\text{Spin}(4) \cong \text{SU}(2) \times \text{SU}(2)$ has two distinguished $4$-dimensional spin representations given by the underlying real representations of the defining complex representations of each copy of $\text{SU}(2)$. The associated bundles of these spin representations are the two spinor bundles attached to a spin structure when $n = 4$, and the final reduction to the first copy of $\text{SU}(2)$ is equivalent to a trivialization of the second spinor bundle.
$B \text{SU}(2) \cong B \text{Spin}(3)$ is $3$-connected with $\pi_4 \cong \mathbb{Z}$, hence $H_4 \cong H^4 \cong \mathbb{Z}$; the pullback of one of the generators of $H^4$ to our manifold $X$ along the classifying map $X \to B \text{Spin}(3)$ is presumably the Euler class of the corresponding spinor bundle. It is an obstruction to the trivialization of the corresponding spinor bundle, and in this case it is the only one: it vanishes iff the map $X \to B \text{Spin}(3)$ lifts to the homotopy fiber of the universal Euler class $B \text{Spin}(3) \to B^4 \mathbb{Z}$, which is $4$-connected, hence maps into it from a $4$-manifold are nullhomotopic.