The ability to lock gates came with the World Adventures EP, so if you have that expansion installed, you should be able to lock any gates. Aside from needing fences to be put on, gates should function exactly as doors do.
If you need to keep Paparazzi away, then you need to correctly install an electric gate, these are found on most celebrity villas in Bridgeport and should be available in Build Mode also. To function correctly, the gate must be set as the front door(if you cannot do this, check the front door of the house itself, and unset the front door, then you'll be able to set the gate as the front door), and the fence it is installed on must be built totally around the lot (if there are other gates in it, these must be locked so that only household members can enter).