eBikes use rechargeable batteries to power the motor. On many eBikes, the battery can be one of the most expensive components on the bike, often times costing $1,000 or more by itself. The size and quality of the battery will determine how many miles the bike can go, or its "range". The quality of the batteries will also determine how long the batteries will last before needing to be replaced.
Most manufacturers will publish the longest range possible that the battery will go, based on ideal conditions. Battery range is affected by many variables: The weight of the bike, the rider's weight, the power of the motor, the efficiency of the motor, what level of assist you are using, how much you use the throttle, how many hills on the route, how fast you are going, how windy it is, etc. Published numbers across different manufacturers are hard to compare. Try to find a review when looking at specific bikes for real world expectations.
Batteries are typically rated in Watt Hours (Wh). A 500 Wh battery can deliver 500 Watts continuously, for one hour (or 250 Watts for 2 hours, or 1,000 Watts for 30 minutes). You can somewhat match the batteries Wh rating with the motor's nominal wattage to determine range, but there are still so many factors to consider because generally speaking people are not riding the exact same speed on perfectly level ground with no wind. Everything else being equal, larger Wh batteries will have longer ranges (and are also heavier and cost more).
Some bikes require the battery to be removed for charging, and some bikes can recharge the battery while it is on the bike, and some can do both. Look for bikes that have removable batteries. You will want to remove the battery from the bike for transportation, security, winter storage, and charging, as well as making it easier to replace when needed.
Higher end bikes will incorporate the battery into the bike's frame, resulting in a much cleaner looking bike. Some eBikes have an option to add a second battery to get double the range. Note that eBikes are considerably heavier than their "acoustic" counterparts, and are difficult (if not virtually impossible) to pedal without the motor's assistance (in other words when the battery dies). Plan your trips accordingly!
Recommendation: Look for a bike that has removable batteries. When looking at batteries, be knowledgeable about manufacturer's claimed battery life. Look for online reviews of the bike. Most manufacturers will publish the absolute longest range in the absolute best conditions. Ask the manufacturer for more detail about the battery performance. Buy batteries from a reputable manufacturer. If a published spec looks too good to be true, it probably is. You can Google for eBike motor and battery range and find a number of sites that allow you to enter a number of variables to guess an eBike's range.
So How Far Can You Really Go? Some Real World Example Data:
Paved bike trail
My bike is 65 lbs, I carry about 16 lbs of gear, and I am over 250 lbs
My bike has a Class 3 motor, so it isn't quite as efficient as a Class 2 motor (you will get slightly better results with a Class 1 motor)
My primary battery is 500Wh
I can get about 23 miles on a single battery at the highest Power Assist Level 4 while pedaling faster than a leisure level
I can get 53 miles on a single battery at the lowest Power Assist Level 1 (with occasional boosts for big hills) while pedaling at a leisure level