I am beginner to photography, and I've learnt that we can do a lot of post-production in images by using RAW format. I'm looking for options to change/modify the depth of field in the RAW images - is this possible?
No - the aperture is set by the physical blades in the lens when you take the photo; a RAW "image" contains the readings from the sensor when the photo was taken, so there's no way you can go back and modify the light which was captured by the sensor. While it's not as obvious, this is equivalent to asking "Can I modify what the camera was pointing at from a RAW image?"
The closest that we have at this point in time is a Light-field camera which does allow you to modify things like the depth of field and the focal plane after the shot has been taken.
For the purpose that you are asking the answer is "No". Sort of.
Unless you are using what is known as a Light Field Camera such as the Lytro, you can't change the aperture at which the shot was taken after the fact any more than you can change the shutter speed.
There are editing tools that allow you to artificially create blur to parts of an image, but at present they don't look very natural as the blur isn't applied gradually to things closer and further away from the point of focus. There is also the problem of the edge between what is and what isn't blurred being very abrupt in much the same way as how subjects cloned into another background look.
There are, however, many things we do to an image after taking the picture that can affect the Depth of Field (DoF). Any time you crop an image and display the crop at the same size as the original you are altering the Depth of Field. Any time you increase or decrease the display size at the same viewing distance you alter the DoF. Anytime you change the viewing distance of the same photo you alter the DoF!
Understanding what DoF is and what it is not is important here.
In a way, depth-of-field is an illusion. There is only one plane of focus. Everything in front of or behind the point of focus is out of focus to one degree or another. What we call DoF is the area where things look, to our eyes, like they are in focus. This is based on the ability of the human eye to resolve certain minute differences at a particular distance. If the slightly out-of-focus blur is smaller than our eye's capability to resolve the detail then it appears to be in focus. When you magnify a portion of an image by making it larger or moving closer to it you allow your eye to see details that before were too close together to be seen by your eyes as separate pieces of the image. There is no magic barrier beyond which everything is equally blurry and inside of which everything is equally in focus!
Since things are gradually blurrier the further they are from the point of focus, as you gradually magnify the image the perceived depth of field gets narrower as the near and far points where your eyes can resolve fine details moves closer to the focal plane.
No, its not possible with a single photo.
But you could take multiple photos, at different focus points or apertures. Then they can be combined in post processing, to give the effect of a different depth of field. You would have to keep the camera in the same position between shots, and it wouldn't work for moving subjects. This could work for either RAW or JPEG images.
It would be possible for a camera can do this automatically. eg some of the Panasonic Lumix models are due to get a Post Focus feature. This takes a burst of 4K photos at up to 30 frames per second, while shifting the lens to different focus areas. So you can choose afterwards where you want the focus to be.
Photoshop now comes with a fancy "filter" that can add DOF to a image that is overly flat (like a phone picture). You can use another feature to "select in focus" for foreground and then paint a rough grayscale for depth; e.g.
A gradiant top-to-bottom as first approximation, and then paint solid grey rectangles for objects at different distances. Then, the filter uses the grey scale as input distance and simulates a DOF lens characteristic.
This is found in the blur gallery which is fairly new and updated since I did this image, so look up current help and examples.
Yes it can be simulated, but not as a 1 click process. (well some aditional clics needed)
The basic idea is to diferenciate a bit the image from the background. I would diferenciate 3 levels of controll of the effects:
1) This fast filters JDlugoz mentioned, where you define an area of influence.
2) Doing a more elaborated mask and separating the layers.
3) Preparing an an actual Depth Map. This is used a lot in 3D renderings where you have a bitmap with information about how far an object is. Then you can use a Photoshop filter called lens blur.
The problem on points 2 and 3 is that you need to actually make the masks.
(I'll try to make a cuple of samples later)