Annapolis is about 30 miles east of Washington, DC, and 25 miles south of Baltimore. By car it takes around 45 minutes from DC via Route 50, and about 35 minutes from Baltimore via Route 2. There is no direct train service — the nearest Amtrak stations are in Washington or Baltimore, from which you can take a local bus (MTA) or cab.
The WMATA bus system does not extend to Annapolis, but several private shuttle services operate between downtown DC and Annapolis, and the Greyhound/FlixBus intercity buses stop at the Annapolis bus terminal. If you are coming from BWI Airport, a cab or rideshare to Annapolis takes about 25 minutes and is often the most practical option.