You can return or exchange your iPhone within 30 days from the date the equipment was purchased or shipped. But, There is a 10% restocking fee for iPhone returns and iPhone exchanges regardless of where it is purchased (online, retail store, etc.).
Find more on AT&T Returns Policy