I cannot answer for the USAF, but Navy and Marine Corps squadrons have also done this for years. In addition to the pilot, if there is more than one seat the Weapon System Officers name(s) will also be painted, in addition to the Plane Captain. It is an honor to have your name on a plane, and it is done for morale reasons. It does not mean that that airplane is assigned to you alone.
Names are painted based on seniority in the squadron. Typically there are more crews in a squadron than airplanes, so the junior most pilots will have to wait for some time to have their name on a plane. It is a minor rightrite of passage when it happens.
For example, in the EA-6B squadrons I served in there were 4 airplanes, and typically 6 crews assigned. The senior 4 pilots got their names painted, and if memory serves me correctly, the Naval Flight Officers, (NFOs, or WSOs...) who were assigned to their crews were also painted on the same plane. So, while a junior pilot might need to wait a year or two, a brand new NFO assigned to the Commanding Officer's crew might get on right away.
They are painted on with a stencil whenever a change is called for. It is low priority in the maintenance scheme of things, so when a senior pilot transfers out and someone moves up the rung it might take several weeks before the plane is moved into the hangar for some other maintenance interval, and the name is repainted then.