One hundred percent in agreement with using only wine you'd drink to cook with. You wouldn't use other ingredients you wouldn't otherwise eat, would you?
Generally, wine has five components (in varying amounts) that affect a dish: liquid, acid, sugar, tannins, and of course, the fruit from which the wine is made. (Not all wine is made from grapes!
) Most of the alcohol will dissipate in cooking unless, as mentioned above, the wine is added just at the end of cooking. Tannins are the astringent-like substances that are imparted to wine during aging from various sources, but mostly from the oak barrels it's aged in and from the grape skins. Some wines have a lot of tannin, mostly reds, others have very little, usually whites.
One of the advantages of adding wine while cooking a sauce is to deglaze the pan. The alcohol works as a solvent (temporarily though, since it evaporates rapidly). Sometimes a stronger alcoholic beverage such as whiskey is used for this purpose, but in the end the result is the same: you've added liquid with certain flavor properties.
To substitute for wine, use whatever you like that imparts the desirable features of the wine (acid, sugar, tannins, fruit). Apple juice is a good option, if you add a bit of vinegar or lemon juice to it (unless you have access to some rather tart, unsweetened juice) and dilute it some with water if it's too cloyingly sweet. If the fruit flavor isn't an issue, just use water.
I once was making a sauce for a dinner party and found myself out of red wine. I had some unsweetened juice left over from canning plums. It had the desired color and tannins, but was low on acidity. In desperation, I added a tablespoon of red wine vinegar and a little water (the plum juice was pretty thick) and went ahead finishing the sauce. The sauce tasted different than it usually did, but it was perfectly fine and my guests had no idea the sauce was made with plum juice.