Whether your landlord can stop you having guests depends on the type of tenancy agreement you have with them.
If you have exclusive possession of the entire property (such as a sole occupancy AST or joint tenancy agreement), your landlord cannot restrict who can visit.
If you are a lodger, renting a singular room, things might get more complicated- especially if the landlord is also living in the property. However, it would seem pretty unreasonable to exclude guests altogether, especially if this is not stated in your agreement.
Your guest might reasonably cause an issue if they pay you rent to stay in the premises if your contract excludes this. A landlord can also restrict guests who effectively live in the premises because they might be viewed as another tenant.
Your guests are also under the same duties as you. For example, involvement in anti-social behaviour is often prohibited in tenancy agreements. If your guests partake in such activities, your landlord can legitimately ask them to leave.