The local bus company Alsa runs about 1 bus per hour between Malaga and Granada. The journey takes 1.5 to 2 hours. You pay between € 10 and € 13 per person (one way). You can consult the bus timetable in advance.
From the bus terminal in Granada it's 4 km to the city center and the Alhambra. From the bus station you can take bus N° 33 to the Cathedral, one of the highlights. From there continue by bus N° 30 to the Alhambra. Public buses run very frequent in Granada and costs € 1,20 per person (one way).
How do I get to the bus terminal from the cruise port in Malaga?
The Malaga bus terminal is located about 4 kilometers from the cruise terminal. You can walk, but you will probably lose too much time. You can shorten the hike quite a bit by first taking the shuttle bus to Plaza de la Marina. From there it's only 1.5 kilometers on foot. Of course you can also take a taxi for € 10 per taxi (4 persons, one way).