For this year is Venice restricting the amount of visitors entering the city. A friend said you have to stay in the city to be guaranteed entrance.
Not at all. Venice has instituted a scheme for some Summer weekends (mainly, some 30 days of the year), whereby you need to pay an "access fee" to visit the city, at a cost of 5 euro.
People who stay, also have to apply, but do not pay. However, no limits on the number of visitors are being imposed. They have discussed limiting the numbers, but any number so far has been way more than what Venice currently sees on average for a day.
Ciao. We're staying in Venice for a few nights three weeks from now. If it's helpful -- I checked with our hotel & they said that currently there is no paperwork necessary for those staying in Venice (I didn't ask about daytrippers).
To build on Paul's post, here's the information on the current access fee for day-tripping visitors not staying in a hotel or other accommodation. Those visitors also pay a tax but it's paid to their accommodation.
https://www.veneziaunica.it/en/content/venice_access_fee
The fee applies to the dates listed. They are not restricting the amount of visitors although they are restricting the SIZE of tour groups to 25. This is the first season they've tested the day-use access fee, and it could be expanded to cover more high-season or popular event dates next year. Then again, maybe it isn't working all that well so they'll scrap it. We'll see!