If you purchased directly from Apple itself, you have a 14 day unconditional return period. Within those first 14 days post purchase, you can return it for a full refund (or effectively an exchange).
Other Authourzed Sellers will set their own return policy.
If a return is no longer an option, then take it in to Apple for a free evaluation and they will tell you if it is eligible for an exchange under warranty.