it depends what kind of soundcard you have, and what method of recording you want to use.
personally, i use microphone recording because i feel some of the sound is lost in a direct connection.
however, direct boxes have an advantage of eliminating pops and hum that can come from a microphone recording. i use my mic to capture sound from my amp's cabinet when i play, and my mic is connected to the back "line in" of my SB Audigy 2Z soundcard. this is run into Cubase SX 1.0, and i use Cubase to mix/master/edit my tracks and create my songs. i also use Cubase to program drums/bass since i don't have those instruments.
so for me the only cost was a mic (Shure SM57 $99US)
and Cubase SX: (retails at $580US but i paid much less)
of course this assumes you have a reasonably fast computer with a decent soundcard. an unmixed multitrack song can take up to a GIG of drive space before you mix it to wav/mp3 or whatever. if you have many layered tracks, it can go far higher than a Gig.
an alternative to using a mic is to buy a direct box (around $150) and record straight into your computer's soundcard by plugging Guitar > DirectB > soundcard.
you wont hear anything but the sound from the pickups, which is to say it will be very clear recording, but some tone may be lost (up to your ears).
no matter which method you use, you'll need a recording program, and if you want multiple tracks at once, you'll need a multi-track program like Cubase or Adobe Audition. i prefer Cubase.
that's all for computer recording. the other option is get a 4-track or 8-track machine that lets you record and mix tracks onto it, and save them to CD, DAT, or transfer to your computer. Boss, Roland, and other companies make some good ones.