Gravity is additive. Calculate the gravity generated by planet A at point x. Then multiply by a unit vector pointing from x to A - that returns a vector, which gives the gravity a direction. Repeat for planet B, C, etc, then add the vectors.
Velocity is acceleration times time. Every frame, multiply the acceleration vector by the delta time, and add the result to the velocity vector. You can access x, y and z of the velocity vector directly.
A vector simply stores the x, y, and z components independently. A unit vector is a vector of length one - you make a unit vector by taking your vector and dividing each component by it's length, the length is
length = sqrt(x*x+y*y+z*z). You add vectors by adding the components independently. You multiply a vector by a constant like gravity by multiplying it's components independently.