Forever? No. Eventually the sun will engulf the Earth.
But we already use the power of the sun. Hydro, wind, and solar power all come from the sun. There's a post from a few weeks ago discussing it if you care to search. Technically even combustion is solar in origin, since wood, coal, etc. is all from plants that used sunlight to grow.
But "in the palm of my hand"? No, that won't be for a while. Nuclear fusion is still not even net positive in the lab.
The sun is basically just so big that the gravity of all of its outer stuff compresses its inner stuff so much that the atoms of its inner stuff fuse together. When they do, they release an enormous of amount of energy, which is what we experience as the flaming hot sun. This type of reaction, where the nucleuses of two atoms fuse together, is called a nuclear fusion reaction.
In that scene, with Doc Ock, he's talking about building a nuclear fusion reactor, a device that can create that kind of atomic fusing here on earth and collect the power from it. That device would be mimicking the sun by doing one of the things that otherwise only the sun does in our solar system, fuse atoms together.
If we can develop and build fusion reactors, it's long been seen as a holy grail of energy production. The reaction releases a ridiculous amount of energy with basically no byproducts and doesn't require any kind of nuclear or unsafe fuel (and requires 4x less mass of fuel compared to traditional nuclear, and 4 million times less than oil or coal).
That being said, it is extremely challenging to recreate the pressures and temperatures that are inside the sun and necessary for fusion. Right now there is a giant reactor being built in Europe that uses insanely powerful magnetic fields (ITER), and in the US there's a facility that is using lasers to do it (NIF).
Both are promising first steps, but both are decades away from being able to build an actual practical reactor that we could connect to our grid and rely on.
The sun itself is its own energy source. The fusion reactions create energy, but as the elements get heavier and heavier, less energy is emitted. Depending on the size the star will either cool down, or explode violently (possibly forming a black hole). And probably many fates in-between I don't know about :)
You can get energy from gravity by moving something closer to a gravity source, but realistically only to a limit. Gravity gets weaker as you get further away, so you can only get so fast from it before either hitting the object, or being too far to notice the pull.