Can you freeze apples?
Depending on what you're going to cook, there are a few ways you can freeze them.

For most uses, I find the simplest method is just to peel, core, and slice them.  First, you want to keep the slices from browning using one of the following methods:


Dip them in lemon juice.  
Dip in a salt water dip (2 tbsp salt to 1 gallon water)
Quickly steam/blanch (1-2 minutes) to stop the enzymes that cause browning,
Pack them in a sugar syrup (usually used when you plan to serve the apples as-is after defrosting, see link referenced below).  A good ratio is 2 cups sugar to 3 cups of water, plus 1/2 tsp of ascorbic acid to prevent browning.  You'll want to make about 1 cup syrup per quart of apples.


Personally, I prefer the lemon juice method, it's proven to be quite effective for me and I always have lemons in hand in the house.

Freeze apple slices on a single layer on a cookie sheet (in the bottom of the freezer) then transfer to a Ziploc bag when solid.  The sheet method allows them to freeze as fast as possible in the typical home freezer, and prevents them from sticking together so you can portion them as you need them.  If you're going to be storing for a long time, wrap them in plastic wrap and then foil before putting in the bag.

Some people just wash and freeze them whole, though I prefer do to the prep before freezing so I can just pull them out of the freezer and use them.  They will freeze well whole, however I find that the ruptured cell walls cause them to be harder to peel/core after defrosting using this method.

If you're going to make a pie, you can also freeze them with sugars and spices etc (prepared just as you would make a pie filling) in a pie pan.  You can then take them out of the freezer like that, drop the prepared, shaped mixture right into a pie crust, and bake your pie with a slight increase in baking time.

As far as how long they'll last, they'll be safe indefinitely, but will lose flavor after a few months, I wouldn't recommend going past 6.  Stilltasty says 2-4 but I've pushed it further than that and there wasn't a ton of flavor loss.  Might depend on variety of apple as well.

The suggestions on this page are in line with my personal experience (and expand upon them!)