Yes, two days is enough for a first visit to Edinburgh, as long as you accept it covers the Old Town rather than everything. Two days comfortably does the castle, the Royal Mile down to Holyrood, the climb up Arthur's Seat and the free National Museum, with an evening in the Grassmarket pubs. What it cannot fit is Leith, a proper wander round the Georgian New Town, or a Highlands day trip, which is what a third day buys you. The single best decision is to book the castle online for an early timed slot, because the walk-up queue swallows an hour in summer and slots sell out. Base yourself in the Old Town so the castle, the museums and Arthur's Seat are all a short, if hilly, walk from your door. Day one does the monument core, the castle, the Royal Mile and the closes, ending with the crags at dusk. Day two climbs Arthur's Seat early, then fills the afternoon with the museum, Greyfriars and Victoria Street. Expect rain most months, so keep an indoor sight in reserve.