It all depends on the hotel.
According Thai immigration law the hotel has to report the guest name and information to immigration within 24 hours of arrival and therefore they should also ask this information for every guest you may have in your room.
BTW this is only applicable for foreign guest.
But as said most hotels don't really bother.
This is also the case for hotels in Pattaya and Phuket and the rest of Thailand.
Therefore the only way to know if a guest is allowed is to ask the hotel, most hotel will answer you openly if they allow it and if there is a charge or not.