Relation between Electric field and potential 
I am unable to understand from this - sign comes. Which step I have done wrong?
 A: 
Relation between Electric field and potential

The relationship between electric field $\bf E$ and scalar potential $\varphi$ is given as $$\mathbf E= -\mathbf \nabla\,\varphi$$ where $\mathbf \nabla \equiv \textrm{gradient operator}\;.$

I am unable to understand from this - sign comes.

It is worthy to quote from Purcell:

The minus sign came in because the electric field points from a region of positive terminal toward a region of negative terminal, whereas the vector $\mathbf \nabla \varphi$ is defined to so that it points in the direction of increasing $\varphi\;.$ 

The crux of this quote is that the electric field $\bf E$ points in the direction opposite to the direction of increasing scalar potential $\varphi\;.$

Which step I have done wrong?

Remember, change in potential energy $U$ is given as $$U(x)- U(x_0)= -\int_{x_0}^x \,\mathbf F(x)\,\mathrm dx\;.$$
So, your approach should be the work done against the electric field by an external agent in carrying the charge from point $\rm A$ to $\rm B$ and that would imply the work would be given by negative component of the electric field in the direction of motion .
A: $W = q(V_{\rm final} - V_{\rm initial}) = q((V+dV) -V)=q\, dV$
Let $\vec E = E\,\hat i$ and $ d\vec r = dr \hat i$ where $E$ and $dr$ are components in the $\hat i$ direction.
$\vec F_{\rm external} = -qE\, \hat i$ and so $W = 
\vec F_{\rm external} \cdot d \vec r = -qE\, \hat i \cdot dr \hat i = -qE \, dr$
Which gives $E = - \dfrac{dV}{dr}$
As $dr$ is the component of $d\vec r$ in the $\hat i$ direction $dr$ can be either positive or negative depending on which way the external force is displaced. 
Once this expression becomes an integral then the sign of $dr$ is determined by the limits of integration. 
Going back to $W = -q E \, dr$ and assume that $E$ is positive and if $dr$ is positive then the work done $W$ is negative, ie work is done by the electric field and the potential has decreased.  
If $dr$ is negative (as you have in your diagram) then the work done $W$ is negative, ie work is done by the external force and the potential has increased.  
A: To place a charge in the vicinity of an electric field, you should do work against the electrostatic force on the charge. This work done to bring a charge $q$ to an electric field of some other charge configuration from infinity to a distance $r$, in the field is what we call the potential at the point $r$.
To do a work to move a charge $q$ from a potential $V$ to a small infinitesimal distance where the potential is $V+dV$, work has to be done against the Electric field.
The force acting on the charge $q$ is   
$$F = qE$$
So work done to move the charge through a potential difference of $dV$ is:  
$$dW = -F.dr$$  
the negative sign implies work has to be done against the electrostatic force.    
This work is the charge times potential difference between the points a and b (separated by a distance $dr$)  
$$dW = -F.dr = -q(E.dr) = qdV$$
$$or$$  
$$ -E.dr = dV$$ 
$$or$$   
$$E = -\frac{dV}{dr}$$ 
$\frac{dV}{dr}$  is called the gradient of the scalar potential $V$.   
Hence electric field is the negative gradient of the scalar potential. The negative sign came as a result because the potential difference is the work done per unit charge against the electrostatic force to move a charge from a to b.  
However, this equation is valid only for static electrostatic fields.   
The error in your math was that to calculate the work done, the displacement should be against the force. So you must put a negative sign as I did:
$$dW = -F.dr$$
A: What you did wrong, is inconsistent definition of positive direction!
On EQ1, you define the + direction to the left $(V_B > V_A)$.
On EQ2, you define the + direction to the right (-qE).
If you maintain the left designation on EQ2, you will "loose" the (cos 180) term (since -qE is already pointing left) and the -sign will not be canceled.
