i believe amazon sells it for a discount
you get 1 year from the date of purchase
one guy from apple was really nice to me and let be buy applecare 2 months after my 1 year purchase date
If you value telephone support, then you have only 90 days, otherwise your general warranty will last a year and you can purchase Applecare up until it expires.
Correction, you have one year to purchase and register the Applecare online, or it is invalid.
Also if you have never registered the machine purchase with Apple in the first place, Apple will assume the warranty starts on the manufacture date, not your purchase date, so your 1 year warranty may be up sooner than you think.