@Akhil: You are asking a very complicated question that goes out of the realm of simple iOS development. If your question is specifically, "wrap an image on a mug," then it can be approached as, "apply a texture to a mesh object," in which case you'll want to be using OpenGL ES, and have predefined models (with UV mapping) to apply the image/texture on to.
In addition, you could use OpenGL and perform a grid mesh translation (mesh warping)—that is to say you'll take an image on a mesh (with a (grid) resolution) and then manipulate all of the points to create the warp effect. Also, GLKit may help in this process and Core Image may also provide a simple solution.
If you're question is, I have a random image and I want to derive the 3D shape of it, then apply a second image to the derived shape and composite them together, that's even trickier as the first part will take advanced image processing to determine the original object/selection shape.
Here is some additional information:
Cheers and good luck!