Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
all Apple products have an initial warranty, usually 1 year, but not sure if it's the same for the iPhone. don't forget it doesn't cover accidental damage or user stupidity like dropping it in the water.
 
1 year warranty at purchase , AppleCare can be purchased any time with in that year (buy on Jan 1, you can purchase Applecare up to Dec. 31)
 
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0_2 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A400 Safari/6531.22.7)

Apple phone support stops at 90 days, while in store Apple support continues till the end of your 12'th month..... As others have said, you have one year from the time you purchased your iPhone to get the Apple care plan.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.