Your code was close - but you have to wait until the map loads to add graphics. In the snippet below note that it waits until the onLoad event fires to add the graphics to the map. function init() {
var startExtent = new esri.geometry.Extent(-102.5,36.8,-99.8,38.4, new esri.SpatialReference({wkid:4326}) );
var map = new esri.Map("map", {extent:startExtent});
var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer");
map.addLayer(tiledMapServiceLayer);
dojo.connect(map, 'onLoad', function(map) {
//Create graphics layer for counties
var countyLayer = new esri.layers.GraphicsLayer();
var lat=null
var lon=null;
var markerSymbol = new esri.symbol.SimpleMarkerSymbol();
var atts = {};
atts["ID"] = 1;
lat=37.514;
lon=-101.1719;
var location = new esri.geometry.Point(lon, lat, new esri.SpatialReference({wkid:4326}));
var graphic = new esri.Graphic(location, markerSymbol, atts);
graphic.titleField = "ID";
countyLayer.add(graphic);
map.addLayer(countyLayer);
});
}