Hello and welcome! This site is defiantly the best place to get info on almost everything.
Keeping pigs is awesome we have been for a couple years and this year had our first go at breeding them. I’m sure you will get a bunch of great info but here is my take on your questions.
1) Laws vary greatly from country to country and area to area so that’s hard to tell. Here in the state's you can check with a local extension office and they will be more than helpful with that info (not sure where you are, but somebody on here would know more about you area). As far as keeping them in a garden..... If it is a garden you are going to use in the future that is a great idea they will till the whole thing up and fertilize it for you! Just don't expect to be able to use it that year for a garden. If they have enough room, and are well taken after, they don't smell bad so your neighbors shouldn’t be upset about that. It is a good idea not to put them on your property line though... setting them back from your neighbors a hundred yards or so is a good idea IMHO. (Just remember out of sight out of mind)
2) We give our girls an outside area that is about 100 sq ft each and an inside area of about 25 sqft each. They really only need a 3 1/2 sided hut to keep them out of the elements but we built them into the backside of the barn. Just make sure they have plenty of hay or straw or shavings to sleep with. I'm not sure the "minimum" size is but the more room they have the happier they will be.
3) There age at slaughter is a tough call, it has a lot to do with the breed of pig you decide to raise. We raise mixed breeds so they are around 7-8 months old when we send them to butcher. What breed do you want to raise?
4) Fencing is very important, and I'm sure everyone here uses something different. We use welded wire fence 48 inches tall buried 8 inches in the ground with heavy duty steel t-posts every 5 ft. And on the back side a barn...
Anything else you want to know post it in here there are a lot of very helpful people on here !