Some of this answer to this is down to care. You can probably make an inexpensive bubble machine last for a significantly longer time than you expect if you are careful with it. Make sure to keep it safe from a toddler’s rough play, prevent build-up with proper cleaning and remove batteries when not in use. The other detail in the lifespan formula is your use. If you use it daily, it won’t last as many days, weeks, months, as if you only use it once every week or so. Even with all these factors, though, you shouldn’t expect more than a year or two out of your bubble machine.
If, rather than the lifespan of a machine, you’re wondering how long the machine will blow bubbles each use before the batteries die or it needs a refill, expect an hour. Different models will, of course, have different times, but the outliers probably shouldn’t form your expectations. The bubble solution runs out faster the higher the bubble output, expect about 15 minutes to a half-hour for most models.