The bucket kept on second floor has greater potential energy.
Reason — The two buckets are identical containing the same amount of water so their mass is same. Value of g is also same for the two buckets. As the bucket on second floor is at a greater height hence its potential energy is also greater.