Try
expr=5x+x^3+Sin[x];
Replace[expr,__+x^a_->a]
and that should display 3
What that is doing is replacing everything in expr that matches the pattern _+x^a (and that is your entire expression) with whatever the a
matched, which is just your exponent, and that will give you the desired 3.
You could in this specific example do
expr[[2,2]]
and that would extract the second item in expr, which will be x^3, and then extract the second item inside that, which will be your desired 3.