Edit: Oops! Crossed post
They all do the same thing, just different ways of arriving at the same exposure setting.
Manual - you set both the shutter speed and lens aperture, and then it is locked at those values.
Aperture priority - you set the aperture (f/number) and the camera sets the shutter speed.
Shutter prioority is the same, but the other way round - you set the shutter speed and the camera sets the lens aperture.
Programme - the camera sets both shutter speed and lens aperture.
Auto/green square is generally very similar to P, but the camera sets other things for you like the flash, and also locks you out of some other stuff to stop you making a mistake. This varies a bit between different cameras.
In all cases, what you are trying to do is deliver just the right amount of light to the sensor for best exposure. And you can mix and match both the shutter speed (exposure time) with the lens aperture (brightness of the light) to get that correct. Plus you can moderate things further with the ISO which adjusts the sensitivity of the sensor to light.
These are the three adjustments that you use to control exposure, and it doesn't matter how you go about it, or which mode you use. Of course, the objective is to select shutter speeds and lens apertures to give you the creative effect you want, so that is why you might want to work in one mode in preference to another, just to make things easier, but it makes no difference ultimately.
Aperture priority is usually the most versatile for most people and situations, and I think it is also best for learning with. Manual is good if you want to lock the exposure settings, to stop the camera changing things which it might otherwise do. P is good for point and shoot where the creative effect isn't too critical and you just want the right exposure sorted quickly. Full auto is just a pain IMHO!