The slot machine increases the happiness of the settlement. The additional effects it gives depends on the parameter that was picked during Lady Luck, which also changes settler's comments when using it:
Indentured Servitude provides 3 caps per settler per workshop reset
Customer Profiling provides 1 cap and 5 points to settlement Happiness
Lost Revenue provides 15 bonus happiness
All options need to be hooked up to a power source and require 1 power to run.
All three versions improve the Sole Survivor's Luck by 1 after use. This effect lasts until a different Vault-Tec Workshop exercise equipment item is used.
The prototype is located in the Special section of the workshop crafting menu during Lady Luck. Once the quest is finished, the slot machine is located under Resources → Vault.
Workbenches only hold 50 caps maximum from income; generating net-zero profit after 16 days (or less), and/or creating diminishing returns with 16 (or more) slot machines per day.
All settlers will use the slot machine, including guards, vendors, and provisioners who will sometimes leave their posts to play.
Having guards who are playing and not in their posts has no penalty to the settlement defense value, but it may cause them to not be where one needs them if enemies attack your settlement, especially at night when everyone else is asleep and they are free to use the machines.
Having more machines will multiply this effect since it means more guards can play at the same time.