I have come across feature called longer exposures. How it effects photography?
When we have to consider these features?
Why 8s or 30s?
Longer exposure allow you to:
Shorter exposure will allow you to:
A camera that offers a 30s max exposure time limit will also be able to do shorter ones, but the opposite is of course not true (as the limit, by definition, limits the exposure time offered by the camera). That limit on exposure time is actually the limit time the camera allows itself to open for. If you use Tv mode, you'll only be able to go that long. If Av mode, it can only go up to that limit to compensate the exposure, etc. (At the opposite on the time scale, there is also a minimum time, which depends havily on the camera build).
However, you can often also "bypass" the long-exposure limit : some cameras offer another mode where you tell it when to close the shutter, either by pressing another time, or by holding the button pressed (and the shutter opened) until the end of the exposure time you want. [The latter is called B or Bulb mode, on Canon EOS 5d mark ii, for example]. This allows for even greater exposure times (and I don't really know its limitation, apart from noise buildup, the risk the captor may suffer if the subject is bright, the battery life which you'll need in order to save the final picture, and movements of the subject(s), or of unwanted things passing by during those long exposures... And, if not using a remote control, your own ability to keep the button pressed, if your camera is using the "keep shutter open until depressed" mode).
(interrestingly, on the short-exposure limit side: you shouldn't be able to bypass this limit, as it depends on the camera shutter speed, etc. But in some cases, you can cheat that by using specialized very-short burst flashes, and a low light environment, having your subject only illuminated for the flash duration... Sometime used to photograph water drops, bullets going through something, etc)
There is probably many more to add in each, I'll update if I can (or maybe someone will do one of those 1200+ point answer instead ^^)
You'll want to use longer exposures at night in conjunction with a tripod. It will help you capture more of what little light is available and give you clearer pictures.
If you use it during the day, you'll see blur effects for things in motion. The longer the exposure, the longer the blur "streak." I can't think of anything I'd use a 30s shutter speed for during the day though. 1-8 seconds are nice for waterfalls and such.
edit: At those shutter speeds, you'll want to use a tripod during the day too.
What you are referring to is shutter-speed. It can range from fractions of a second to hours. Most large-sensor cameras offer a range from around 1/4000s to 30s. The longer the time, the more light gets in.
At some point, usually over a second or so, people call it a long exposure. There is no point at which it becomes long but there is a point at which you need a tripod, even before it is a long exposure. That point depends on the camera and lens too. Anything slower than 1/15s will almost always need a tripod, so with 8 and 30s, you absolutely need one.
You should familiarize yourself with the Exposure-Triangle because one cannot simply use a longer shutter-speed without offsetting it somehow. Otherwise, the image will over-expose.
While we've mostly changed from film to digital sensors, a photograph is still formed by the summation of the photons that hit pixels (or phosphors in film) over the period of time during which it is being developed. A long exposure gives more time for photons to hit the sensor and thus produces a "brighter" image. If the shutter is open for 3 times the length, then 3 times as many photons can register on the sensor.
Unfortunately however, digital sensors are not a perfect system, some amount of noise occurs in the system which looks like photons hitting when no photons actually arrived. The longer the image is exposed, the longer this noise has to accumulate as well and thus the noisier the image gets. Long exposure noise reduction tries to figure out which of these supposed photons is an actual photon and which is actually noise, but it can't always do a perfect job, so you still do get more noise.
Otherwise, there isn't anything particularly special about a short versus a long exposure until you get in to really fast exposures. It's still simply how long the sensor is exposed to light entering the lens during which it is collecting information about the photons hitting each pixel of the sensor.
Concerning the comment by the author "Now say two cameras one with 30s and another with 8sec longer explosure. Which is best?"
In case you are really comparing two camera models, check if a camera has a BULB mode. This allows to use an arbitrary exposure time by manually stopping the exposure (best using a remote control to avoid camera shake). So a camera with max. 8s shutter speed and BULB mode is more flexible than a camera with 30s maximum shutter speed without the BULB mode.
The use cases for these exposure times have been mentioned already. I'd like to add that you will need to invest in a strong ND filter to achieve these shutter speeds, otherwise you can only use them in very dark conditions. To use them during daylight, you need a ND3 (10 stops, equivalent to 1000x exposure time) filter. They are not cheap and not many vendors make them.