Hi,
Opamp is an amplifier by any means and the ideally has infinite gain, Vout=G*Vin is always true and the signal will never be attenuated, but can be clipped.
If the Opamp is connected in Open Loop configuration it will Amplify input signal ideally by +/-infinity depending if connected to the positive or negative pin of the device. Since the output is limited to voltage power supplies it will limit the output as shown on your second picture.
When you are connecting the Opamp with negative feedback the gain will be as follows:
Non-Inverting topology: G=1+Rf/Rin (gain is always positive)
Inverting topology: G=-Rf/Rin (gain is always negative)
In the case of negative feedback G can be set to be more then 1, in this case it will amplify the input until it will clip the output, and when G is less then 1, it will act as attenuator and will scale down the input, the polarity of the output signal is totally depends on the topology.
So if the Opamp has Gain of -10, that means it will amplify the input by factor of 10 with negative sign, for example:
Vin=0.5V, Vout= -10*0.5=-5V
Vin=-0.5V, Vout =-10*-0.5=+5V
If G=0.5
Vin=0.5, Vout=0.5*0.5=0.25V
Vin=-0.5, Vout=0.5*-0.5=-0.25V
RS