A subnet is used to break a large network into smaller networks (subnets), which makes moving packets of information around more efficient.
The default gateway is the doorway in, and out, of the subnet.
A subnet (bit) mask is a way of telling a computer what size (sub)network it is a member of, and whether the target computer it wants to communicate with is on the same subnet. If it isn't, it forwards the packet to the default gateway. The gateway then forwards the packet of information on to the right place.
You actually use a form of mental subnet mask every time you make a phone call. When you look at a phone number you need to dial, you mentally calculate how many digits you need to dial, based on your current location, area code, etc.
Your own number: 1403 123 4567 ext 517
Number to call: 1403 123 4567 ext 288
You dial: 288
Pseudo telephone subnet mask: 255.255.255.0
Number to call: 1403 991 2214
You dial: 991 2214
Pseudo telephone subnet mask: 255.255.0.0
Number to call: 1671 113 9910
You dial: 1671 991 2214
Pseudo telephone subnet mask: 255.0.0.0
And finally, you can't get the host IP address just from the subnet mask, and the default gateway. All you can figure out is what range of IP addresses the host machine will be in. For example, if the subnet mask is 255.255.255.0 and the default gateway is 192.168.1.1 then the host machine will be anywhere from 192.168.1.2 to 192.168.1.254