What determines the positioning of PAPI lights from the runway threshold?
US DoT Order JO 6850.2B contains installation criteria for visual guidance lighting systems. The following is taken from that order.

For siting PAPI along the runway, in case an (ILS) electronic glide slope is present, the lights are located such that the PAPI visual approach path coincides with the one produced electronically as much as possible.

In case of runways without an electronic glide slope, the following criteria are considered for locating the PAPI:


Threshold Crossing Height



  The TCH is the height of the lowest on-course signal at a point directly above the intersection of the runway centerline and the threshold. The minimum allowable TCH varies according to the height group of aircraft that use the runway, ... The PAPI approach path must provide the proper TCH for the most
  demanding height group that uses the runway.



Glide Path Angle



  The visual glide path angle is the center of the on-course zone, and shall normally be 3 degrees when measured from the horizontal.



Obstacle Clearance Surface



  The PAPI obstacle clearance surface is established to provide the pilot with a minimum clearance over obstacles during approach. The PAPI must be positioned and aimed so that no obstacles penetrate this surface.




Image from US DoT JO 6850.2B Visual Guidance Lighting Systems

Basically, in case ILS is there, align the PAPI with that; else locate the PAPI such that it satisfies TCH and OCS.