Where do stocks get their value from? I'm aware that some companies give out dividends to their shareholders, but are there companies that don't? And if they don't, what incentivizes people to buy stocks at the IPO? Is it simply the belief that other people will value the stocks?
Yes, there are companies that DON'T pay dividends to their shareholders. Some of these well-known companies are:

Amazon.com Inc (AMZN)
Facebook Inc. (FB)
Netflix Inc. (NFLX)

The main incentive shareholders get by buying at IPO is CAPITAL APPRECIATION.
98% of the time, the company will only be listed on the stock exchange if it has strong financial fundamentals. Thus, a case in which no one buys into that company as soon as it goes public is very rare.
Share prices change due to the changes in the supply and demand of that company's share. Hence, when the company's IPO is launched, a lot of retail as well as institutional investors buy into that stock and increase the demand for it, while the supply stays relatively stable.
This increases the price of the company's share in the short run. However, if the company has strong financial fundamentals its price would continue to grow steadily. But if a company has weak financial fundamentals, the company's stock price may even drop below its IPO price after a few days of its IPO's launch.
Below is the price of Facebook. Inc since its IPO launch. As the company had strong fundamentals it grew into the social media giant it is today.

However, a company like Groupon had a minute increase in its price just for a few days after its IPO launch due to the rapid increase in demand as discussed above. However, because the company did not have strong financial fundamentals, its price gradually started to lower.

So what incentivizes people to purchase a company's share AT IPO?
The very high probability of the stock to jump above its IPO launch price for a few days.
After which, its price is determined by the company's VALUES/ FINANCIAL FUNDAMENTALS
Cheers!