I'll assume you mean 2 hours riding time since for most anywhere you'll probably want to go it will take you close to that to get out into the country and back. I did an afternoon horseback ride with my brother many years ago on the slopes of the Barva Volcano above Heredia. Unfortunately, I don't recall how I hooked up with it. A quick Google search turned up these links for half day horseback tours out of SJ:
http://www.costaricadestinationsdirect.com/tour.php?t=23106http://www.costaricaindex.com/horse.htm
http://www.costarica-tours.net/tours/tourDetail.cfm?tour_id=7818
http://www.adventure-tours.us/tours/tourDetail.cfm?tour_id=7818
http://www.crgreenforest.com/odt_horsebackRiding.php
http://www.1incostarica.com/index.php?option=com_estateagent&act=object&task=showEO&id=49
http://www.graylinecostarica.com/tours/horseback.php
http://www.accesstoparadise.com/costa_rica/adventure_tours/horse.html
http://www.costaricamap.com/ing/acthorseback.html
The first 7 all sound like the same tour being offered through different agencies. The prices vary a little between them but that could be because some of the postings haven't been recently updated. You'll need to call/email around. The eighth one (Valle Escondido) is a bit far from SJ being about halfway between San Ramon and Fortuna, but gives you their rate including transportation from SJ. If you're willing to go that far from SJ, you can also do horseback riding through the Varablanca at the Lost Angeles Cloud Forest or at Lands in Love. You just might need to figure out how you'll get out there on your own. And Turu Bari has a 1.5hr guided horseback ride. There is also a lot of other stuff you could do and see at Turu Bari, such as the zip-line, various nature exhibits, etc.. The potential problem for you is that I don't think they'll arrange transportation from SJ for just a couple of hour visit to ride horses, but if you wanted to combine the riding with a bunch of other activities that could be your best possibility.
These are just the ones that you can find being marketed over the web (and therefore are priced and packaged accordingly). You may be better off checking with the tour desk at your hotel (or at the HDR tour desk) as they may have info on some tours that can't be found so easily on-line.
If you're a little more adventurous, the best deals may just be to ask around. Somebody may have an uncle they can hook you up with who still lives out in the countryside around San Jose on a small farm with a horse. Or you can take a drive out to the country and just ask the first guy that you see on a horse that doesn't look too fleabitten whether he has another one you could ride if you paid him a few bucks for guiding you through the fields for a couple of hours. He may look at you like you were kinda crazy (tico farmers ride horses to get around not for pleasure and tico city dwellers look at riding horses as something that only poor country folk do), but I bet he'd be happy to oblige.