They are both OK and mean the same thing.
To jump out is to jump from inside something.
To jump off is to jump from on something.
With a tree, it's the same thing. (as being on a tree branch is also being in a tree)
If it was a building:
To jump out of a building = jump from a window
To jump off a building = jump from a ledge (maybe window ledge) or from the roof
Another example of when it's the same:
Jump [out of / off] a train.
Because if you are IN a train you are also ON a train. If it's from the roof (or some other exterior) of the train, you can only use "off".