How convenient that I just wrote a post explaining this quite literally thirty seconds ago. Here's what I said then:
"Alliances are what two civs that are already at peace, and that REALLY like each other, can sign. First, both your civ and the other must have the Alliance tech (not too hard, once you have it, give it to them). Second, relations between your two civs must be "Close" (that being the closest relationship possible). If your relationship isn't close, the Alliance option will NOT appear in discussions with them. Once you get the relationship to Close, you can offer an alliance, [though] you may or may not have to through something else into the pot to get the AI to bite."
Hope that helps.
- Ash
~SDC~