VLSM (Variable Length Subnet Mask) is used to add flexibility to a networks subnet scheme.
Normally, LAN would use 1 subnet mask for the whole organization. For example, if your base IP address was 172.16.15.0, you have a Class B address. If you need more that 30 subnets you could subnet you could "borrow" 6 bits (extend your network prefix) and your number would now be 172.16.15.0/22. This would give you up to 1,022 hosts per segment. You would be limited to this subnet mask for the whole organization.
If you need more that 500 hosts per segment, this would be fine. But what if some of your smaller suborganizations need only about 40 or 50 hosts - you are wasting a ton of IP addresses.
VLSM allows you to "subnet" inside your subnet. This would allow you to have both a 22 bit network prefix and a 25 bit network prefix.
You would also need to use a routing protocol that supports it (RIPv1 would not, RIPv2 and OSPF would).