I understand that electrostatic potential is scalar because the curl of the field is zero, and this implies the electrostatic field is the gradient of the scalar potential to satisfy this. Similarly the divergence of a magnetostatic field is zero so a magnetostatic field is the curl of the vector potential.
But what actually determines when you would use which potential? Is it purely to do with these definitions in electro and magneto statics, or is it something else?