I agree with @The Photon answer.
First, as @The Photon noted, the force $F$ in the formula is the force that the electric field exerts on the charge. Consequently the negative sign in the formula is for the work done by an electric field where the force of the field on the charge is opposite to the direction of movement of the charge. This means the electric field is doing negative work on the charge taking energy from the charge and storing it as electrostatic potential energy (increasing its electrical potential). The charge gets that energy from an external electrostatic force that does an equal amount of positive work on the charge. The gravity analogy is taking a mass at rest off the ground and placing it at rest a height $h$ above the ground. You do positive work $mgh$ to move the mass. Gravity does an equal amount of negative work $-mgh$ taking the energy you supplied and storing it as gravitational potential energy
Note, however, that if instead the electrostatic force in the same direction as the movement of the charge, the field would be doing positive work decreasing the electrostatic potential energy of the charge and giving it kinetic energy. The gravity analogy is the positive work done by gravity on a falling object.
So to a certain extent the selection of the sign is arbitrary. However in electrostatics the potential at an infinite distance from a fixed positive point charge is arbitrarily assigned zero potential. This is logical since the strength of the field of the point charge approaches zero an infinite distance away. Now if another “test” charge at that infinite distance is to be moved toward the fixed positive charge its potential will either increase or decrease depending on the polarity of the test charge. If the test charge is negative, in moving it towards the fixed positive charge the field will do positive work and the potential of the charge will decrease. If the test charge is positive, the field will do negative work and increase its potential. The latter is the basis of the formula.
Hope this along with the other answers helps.