One set is commissioned by the National Portrait Gallery for each POTUS/FLOTUS.
The portraits being discussed above are a gift to the public from the White House Historical Association, the organization founded by Jackie Kennedy in 1961, to "to protect, preserve, and provide public access to the rich history of Americas Executive Mansion."
In addition to commissioning the portraits of the current occupants (beginning in 1965), the association has also worked to acquire portraits of prior POTUS/FLOTUS from other collections. The artist nowadays is selected by the First Couple, and unveiled after their term is complete, normally in a ceremony hosted by the current POTUS/FLOTUS. The Obamas hosted the Bushes ~ 2012 in a cute, non-political event. Trump refused to do the same for the Obamas. (He also moved the paintings sets of 42 and 43 (I think those were the ones) out of the prominent position in the building usually accorded to the most recent presidents.)
I don't know what they're going to do with Trump though. There are paintings of the Nixons in the collection, although no ceremony took place for them. After the WHHA commissioned one in 1981, Nixon commissioned his own in 1984, and gave it to the collection! (When the beautiful portraits of JFK and JBK were completed in 1970, the Nixons hosted Jackie and the children for a private unveiling, since she didn't wish to have a public ceremony.)
You can see the paintings here (if this longwinded reply hasn't put you to sleep). A number of them are very done.