What happens if I cast darkness on an arrow and then shoot an enemy with it? Assuming it hits, does the effect stay with the person who was shot? Does the arrow stick into the target, or does it fall to the ground or something? Can the person who was shot rip out the arrow and throw it aside? Since the arrow is "destroyed or rendered useless", does that mean that the spell no longer applies?
If you are looking for a way to accomplish something similar, there are some ammunition and thrown weapons that get stuck in the target.
The most price effective is the Robe of Needles. For only 1,000 gp it gives you 6 thrown weapons a day that hit with a touch attack and require a full round action to remove. The needles are destroyed when removed so your foes can't throw them back at you.
Unless you want to arm your enemies with thrown darkness, I cannot recommend the Hunter's Starknife. It explicitly gets embedded in your target, but, after spending a full round action to remove it, they now have a +2 wounding starknife.
Burrowing Bullets are designed to stagger you oponents. They can easily carry another spell or spells with them. They have a lot of downsides; they are expensive (1,722 gp or 3,447 gp), remove themselves in
1d3 + 2 rounds, and can be easily removed (DC 15 or DC 20 Heal check). Burrowing bullets can be fired from a musket with a 40ft range increment.
Forewarning: This is probably actually a terrible strategy in Pathfinder. Pathfinder's version of darkness, unlike the 3.5e version, does not give the people inside that darkness any problems seeing out of it — in fact, they just get benefits of being harder to see. Pathfinder's version of darkness seems to be not so much a cloud of blackness, but instead an area where the lights got turned down a bit to give you some shade or cast you into shadow. It's pretty helpful.
You'd probably be better off delivering darkness to an ally, in which case just toss them a rock of darkness to hold onto and save them the arrow wound and yourself a mechanical conundrum.
Your group might be interpreting it differently, though. Anyway, let's move on with your actual question.
What happens if I cast darkness on an arrow and then shoot an enemy with it? Assuming it hits, does the effect stay with the person who was shot?
It stays on the arrow, which is stuck in the person who got hit. Yes, you've delivered darkness to your target.
Does the arrow stick into the target, or does it fall to the ground or something?
Arrows don't work by hitting people then bouncing off. They dig in and stay there.1 Unless you're engaging in funny business, like using super-strong fantasy arrows that fly straight through and hit the opposite wall, your arrow's going to stay put.
Can the person who was shot rip out the arrow and throw it aside? Since the arrow is "destroyed or rendered useless", does that mean that the spell no longer applies?
This is where things get tricky, since you're outside rules territory entirely.
In real life, removing an arrow is a tricky bit of surgery, and has to be done carefully to avoid causing even more internal damage. Arrows don't get "ripped out" in the middle of a fight; at best you can only snap the shaft off.
Pathfinder doesn't care about that though. Arrows generally vanish from the rules system's purview once it lands in someone. There is no "carefully remove all the arrows you got hit by during combat" subsystem, there's just soldiering on, abstracted rest, and abstracted healing. (This is probably for the best.)
Plus, Darkness does not care if the object it's cast on is broken or damaged in any fashion - so an arrow keeps its Darkness, broken or not.2
In general I'd recommend: No, you cannot trivially remove that arrow in the middle of combat. Snapping it off won't make Darkness stop working. You can probably justify that arrow being pushed out of your body when you're healed, but then you still have a damaged arrow with Darkness cast on it right there at your feet in combat - do with it what you will.
1. HP abstraction suggests you could just be taking the damage from dodging, but this is a system with poison arrows, and you don't get poisoned from those by dodging them. I suggest that an arrow that hits is probably an arrow that really hits, as far as things care. Your character's a fantasy hero, they'll be fine. Also, given how much Pathfinder cares about and defers to reality, I'm assuming arrows that hit don't then vanish.
2. This raises the question of what happens if you cast Darkness on an item, then divide it up. I'm not going to go into this though, since that's a big tangent for arrows the rules system already considers nonexistent.
Even if a spell's cast upon it, an arrow that hits is destroyed or rendered useless
Near here, in the section on Melee and Ranged Weapons in the subsection Ammunition, the game says that
Generally speaking, ammunition that hits its target is destroyed or rendered useless, while ammunition that misses has a 50% chance of being destroyed or lost.
Thus it's a sad truism of Pathfinder archery that arrows are disposable. An archer hits a target with an arrow and Bam! That arrow can never be used again. It stops being an arrow, its arrowness present no more. Even adamantine arrows are destroyed or rendered useless when they hit targets.
Except in special cases, the game doesn't distinguish between parts of objects (e.g. arrows and arrowheads). Arrows aren't special cases; salvaging an arrow's fletching, head, or shaft from a destroyed or useless arrow isn't a thing unless the GM says it is.
One can cast the spell darkness on an arrow. One can launch such an arrow at a target. But if the arrow hits the target, it deals damage and is destroyed or rendered useless—even if that target is the ground. An arrow that hits is just not the arrow onto which darkness had been cast anymore, but something destroyed or rendered useless.
Don't let the lack of darkness arrows get you down
While this does kind of suck because it eliminates some awesome arrow tricks, many creatures would exploit such a tactic were they able, often to the PCs' detriments. Consider the possibility of the drow, each of whom can use darkness as a spell-like ability 1/day and the terror that would be wrought on the surface world were arrows coated in darkness to embed themselves into the approaching forces of good. Creatures who can cast the spell silence or, arguably, even explosive runes could do the same.
In addition, as an unsupported house rule, the GM would be forced to develop more complex and granular rules for both glancing shots and embedded arrows, probably making dealing damage and hp more concrete than the largely abstract way they're handled now, possibly sending ripples throughout the system with unknown and unintended consequences.
A case against durable arrows
Including durable arrows in the campaign adds a wrinkle that I'm almost certain was unintended by the arrows' designers. Paying 1 gp each for a reusable arrow is actually reasonable, but providing no precise details for those arrows' use isn't. Pathfinder has no glancing blow versus impaling rules, no detailed rules for surgical extraction of embedded objects, and no method for yanking out embedded objects on one's own. Durable arrows add unnecessary complexity.
Seriously, cast darkness on something you know sticks to the target instead of on an arrow and save the GM some grief.
While this is a Pathfinder question I would like to draw some attention to the 3.5 book Drow of The Underdark. On page 44 under tactics: Darkness it lists attaching darkness to an arrow and then shooting it into the ranks of enemies, and then they struggle with the darkness. While this is 3.5 material it does imply that even if the arrow is ruined/wasted the location where it fell should be affected by the spell, and since many aspects of 3.5 carry over into Pathfinder, its reasonable to conclude that this effect would.
http://www.d20pfsrd.com/classes/prestige-classes/core-rulebook/arcane-archer In arcane archer under the imbue arrow ability "At 2nd level, an arcane archer gains the ability to place an area spell upon an arrow. When the arrow is fired, the spell's area is centered where the arrow lands, even if the spell could normally be centered only on the caster." So this seems to support that the spell would remain in effect after the arrow is no longer viable.
A couple of key parts to consider.
When (magic ammunition) misses its target, there is a 50% chance it breaks or is otherwise rendered useless...if it hits a target it is automatically destroyed after it delivers its damage.
True, a mundane arrow/bolt with a spell cast on it is not considered "magical" (although mudane ammunition has identical outcomes when fired) this the closest the rules actually come to answering your specific question.
However, we do have additional material to pull from:
Consider a Flaming Arrow, when this arrow hits a target ot deals 1D6 fire damage in addition to base damage. Now if the arrow was destroyed but the flaming property continued to work the victim of this arrow would have to continuously take fore damage until the arrow was removed!
This is as close as the rules get to spelling out an answer to your exact questions but it's not hard to draw the line the rest of the way ourselves. However, if you tied a string to the arrow before firing the string would remain intact and continue to produce the effect.
A simple work around would be to simply cast it on a regular item and throw it in the direction of your intended target.
Ofcourse both your intended method and the work around solution would require your character being able to see through the darkness created on the object you intended to throw so that you could get it in the right direction to begin with.