See Building Railway Depots for a detailed tutorial on how to build railway depots.
Depots are buildings where trains, road vehicles and ships are built, stored and serviced. Aircraft use hangars which have the same function as a depot but are only available as part of an Airports (en).
Depots have no limit on the size or number of Vehicles (en) they can hold at one time. (So they can be used, for example, as Escape depot in front of a Railway station (en))
Railway Depots have a built-in two way signal (it works as a entry pre-signal in a pre-signal set).
To view inside a depot or a hangar, click on it. You will be presented with a window showing any vehicles in the depot/hangar.
Clicking on a vehicle will open the window of that vehicle. A Right-Click will show the name and capacity of the vehicle. For trains a Right-Click while holding Ctrl will show the total capacity of the train, starting with the vehicle that was clicked on until the end of the train.
Clicking New Vehicles will present you with a list of available vehicles, which you may then build by clicking Build Vehicle.
Vehicles will periodically return to the depot to be serviced. This restores the reliability rating (preventing them breaking down so often) and prolongs the working life of the vehicle.
You may put a depot on the Orders (en) list for a vehicle (in the same way you would a Stations (en)) to force it to be serviced at a particular point on its journey (for example before a particularly busy station where you definitely don't want it breaking down). And you may use the "service" option on a goto depot order to have the vehicle to execute that order only if it need to be serviced. See Allow goto depot orders (en) page for further informations.