You can leave the airport. Obviously, you'll have to go back through security... just don't miss your flight! You may want to call American and see there's a later flight out of Boston or earlier flight out of RDU since you now have such a long layover.