A single axis of the accelerometer will experience an acceleration from gravity based on this equation.

a = g * cos(θ)

So if you have "a" from your sensor, then you can compute the angle with the equation:

θ = cos^{-1}(a/g)

cos^{-1} is also known as the arccosine or acos.

The angle returned from an acos function will likely be in radians.

One problem you are likely to have, is the accelerometer can't tell the difference between the acceleration from gravity and the acceleration from the motors. You really need to use gyros and accelerometers together to keep a balancing robot upright.