I understand that the potential between the plates of the capacitor increases as the circuit runs, but why it stops increasing exactly when it becomes equal to the potential of the battery?
Let's say we hook up a capacitor to a battery (and maybe toss a resistor in there). The battery will pump a charge difference between the plates, which creates a potential difference between the plates. When the potential difference reaches the potential difference of the battery, current that takes and adds charge to the plates stops flowing, as current only flows when there's a potential difference (look at Ohm's law!). Thus we achieve a steady state of no current when the capacitor is charged to the potential difference of the capacitor.
Note that the above argument assumed very simple circuit elements. Adding something like an inductor will cause the behavior to change dramatically.