brhans got it already quite right: The TL082 is unsuitable for your problem, neither it supports input voltages close to the negative supply pin, nor it is able to output voltages near the negative supply.
The TL082 is meant to be supplied with a negative voltage way below any signal voltage that occurs in your circuit. Typically, op-amps like that are powered from a "split supply" that emits a voltage higher than all positive signal voltages as V+ and a second voltage V- which is lower than all negative signal voltages in that circuit. Usually, GND is in the center between V+ and V-. In your case, you need the operational amplifier to work when you have a positive supply voltage significantly exceeding the positive peak, but no negative supply voltage exceeding the negative peak, you just have ground. Because you have a single supply voltage "V+" instead of two of them, called "V+" and "V-", this operation is mode is called single supply, and operational amplifiers that work with input and output voltages close to ground are called "single supply operational amplifiers".
Another problem is that the data sheet starts with supply voltages of +/-5V, which means GND + 5V at V+, and GND - 5V at V-, which results in a difference of 10V. It does not tell you anything about operation at a mere 5V supply, at probably the chip would perform quite poor even if input and output voltages are near to 2.5V.
The suggested LM358 is a very cheap operational amplifier which is designed to work with inputs near the negative supply. The LM358 datasheet thus explicitly states in the highlights:
Input Common-Mode Voltage Range Includes Ground
The output voltage of the LM358 should be above 0.6V, because the chip is very weak at pulling the voltage lower. The datasheet still claims that the output can swing to ground, which is technically true, if there is no significant current to sink.
The LM358 does not have JFET inputs as the TL082 and thus consumes a measurable amount of current at the inputs (while op-amp theory tells you an op-amp would have infinite input resistance), this current is called the input bias current, and the data sheet specifies around 50 nanoamps which flows from the positive supply out of the input pins and must be delivered to ground by external circuits. The resistors in your example are low enough that 50nA shouldn't matter, though. Similar op-amps exists with a single amplifier in a 8-pin package (LM321) and 4 amplifiers in a 14-pin-package (LM324).
One example of better cheap single-supply opamp than the LM321/LM358/LM324 series is the TLC27x series.
The circuit on the right side makes use of an LM 108 and a capacitor
on pin 8 ( due to the datasheet pin 8 of the op amp stands for Comp).
Not having this pin on L358 what can I do for that?
The LM108 has pins for external compensation. As you've already figured out you will not find these pins on the LM358 because the LM358 is internally compensated (e.g. the capacitor is within the chip). So if you use the LM358 you don't need that capacitor.
Morever the arduino analog pin normally indicates a value btw 0-1023.
Now using the op amp I get a maximum value of 767 ( this means approx.
3/4 of 1023). Is there any particular reason for that or am I doing
any mistake?
The output of your amplifier does not generate a voltage that the arduino would interpret as full scale. You can increase the amplification by choosing a bigger resistor between the output and the negative input. If you want your amplification 25% higher just make the resistor 25% bigger.
Note that the voltage at the LM358 output can't go as high as the supply voltage. It will always have a maximum output voltage that is 1.5V to 2V below the supply. That means, if your arduino analog input would give you a full scale at - lets say - 5V, then you need to supply your OpAmp with 7V at least. Otherwise the output will clamp and never reach the full scale.
You'll also likely don't want to connect your OpAmp output directly to the analog input. Analog inputs have a maximum input voltage, and you should never exceed this. If you do current will flow through a protection diode. If the current is to large that could blow up your arduino. Adding a resistor between the OpAmp output and the analog input will limit the current without influencing the reading much. 2.2k is what I usually use as a rule of thumb value.
Best Answer
Every time you take the input voltage higher than 0V you are "asking" the op-amp to produce a negative output voltage - this circuit is an inverting precision rectifier - it is trying to make a negative voltage on the output follow the positive voltage on the input. With no negative supply it doesn't work. With a positive bias and no negative supply it doesn't work.
Try a negative bias on the input or a positive bias on the non-inverting input.
Alternatively swap the diode directions and let a positive rectified output from the op-amp properly follow a negative half cycle on the input.