Is electrostatic potential energy of a charge is different depending on whether the electric field attracts or repel the given charge?
Yes and No.
Yes they are different in the mathematical sense. No because the magnitude would be the same.
For an example, take a look at something that is familiar:
Gravitiational Potential Energy. To lift a mass at a constant rate, the amount of work done on the system by an external force (provided by a person lifting, for example) is how the Gravitational potential energy changes.
This can be stated as a form of the first law of thermodynamics
W = ∆PE
Where W > 0 when you work against the field, and W<0 when work with the field. - Say we release the mass, the field causes the mass to accelerate with the field.
mass reacts to a gravitational field much like a positive charge interacts with an electric field. (Remember, field lines are defined in the direction a positive charge would accelerate by convention).
A negative charge in the same field would accelerate the opposite way. Imagine an object that would do that in a gravitational field! Where does such an object have 0 PE? Really far away. So the amount of potential energy is the SAME, but it has a different SIGN meaning whether or not you need to work WITH the field (-) or AGAINST (+) the field to move that charge.
Finally, look at the equation for potential energy between two charges.
if the charges attract, the potential energy is negative. It will require work to separate the charges.
if the charges repel, the potential energy is positive suggesting that it will take work to position the charges closer together.
Notice, though, that the magnitude is the same.