On your farm you can build anything you want with the available items in the game. When you first start the game you are given enough supplies to build a small house, such as the one shown in the image on the left. PS. When you first start the game get this house built ASAP, you'll need a toilet and a bed early on in the game.
When walls are placed they start as a single unit. Adding further walls causes the walls to link together based on where other walls are placed. Walls are necessary to place floors and certain other objects. Currently there are 3 types of walls, which are wood, brick, and fences. The character and animals are unable to walk through walls, allowing you to seperate objects from livestock. All walls act the same, even fences.
Windows can be placed on any wall (even fences), and exist purely for decoration (honestly they don't do anything).
Doors and Gates allow you to create a passage in walls that only the player can walk through. The player can also ride their horse through doorways allowing you to put your horse into an enclosed pasture or building making it easier to find when you want to ride it.
Other Objects such as toilets and showers can be placed on floors inside. These objects may be necessary to deal with the characters needs.