I have heard that a capacitor increases the voltage of output in a circuit can anyone explain it
It does not. You may have heard that a capacitor increases the stability of the output voltage of a circuit.
Yes, in conjunction with inductance of the AC voltage source it can increase voltage output. Loses must be realitively small for that to happen. Easiest way to see it is to draw the phasors diagram. Typicall example is capacitively loaded transformer.
It is a very generic statement - in a rectified DC case ( like a wall wart) the added capacitance can help reduce the ripple, this can, in many cases increase the average output voltage. In an AC case - if the load has a large inductive portion ( most do) adding capacitance provides the current to the inductive (reactive current) portion of the load - so the supply only needs to supply current to the Real part of the load - less current in the supply will decrease the voltage drop and increase the voltage.
Separate names with a comma.