There is no border control between Italy and San Marino.  Know that San Marino is not a member of the European Union or European Economic Area. But Italy is. So depending on your passport (or visa) requirements for Italy, you will have to follow the same for San Marino.  If you need a Schengen Visa for Italy, then you will need to have the same for San Marino.