You can usually leave the airport with a carry-on, but the better question is whether you should. A rolling bag changes your route, your restaurant choices, your museum options, and your re-entry stress.
Check airport storage first
Some major airports have a baggage storage counter. Many do not. Search the airport's official services page before you count on lockers, because public self-service lockers are uncommon at U.S. airports.
Ask your airline about early bag check
If your next flight is on the same ticket, your checked bag may already be tagged through. If you still have a bag with you, airline counters may accept it only within a set window before departure.
Do not treat gate check as storage
Gate checking is normally for items accepted at boarding. It is not a reliable way to drop a bag, leave the airport, and retrieve it later. If you need your hands free, use official storage, hotel storage, or a bag-friendly plan.