If you're just pointing the camera up and taking a picture, you're going to end up with camera shake from when you fire the shutter. You need to use a tripod and a remote.
Then, taking long exposure shots of the moon or other celestial bodies, you're going to have to compensate for the rotation of the earth.