Every domain name has at least two nameservers assigned to it. Those nameservers hold the records for the domain name, letting other servers know exactly where the website is. When a server queries the nameservers for the DNS records, it usually caches the results, keeping a local copy of the DNS record so that the next time it needs to know what IP address the domain name resolves to, it already has the answer. ISPs use caching to speed up their network response times, and most domain names do not change from their existing nameservers or IP addresses.
But when a change is made to the DNS records, these changes have to reach the other servers. The servers are set to refresh their cache, getting the new information, but each server is on its own schedule. Because of this, we normally state that it will take 24-48 hours for the changes to propagate, to ensure that all the servers have refreshed their cache and now have the correct DNS records for your domain name.