No you say it any time a meal is being consumed or they are sitting down to start eating, at home, at a beach,restaurant, etc.
Even for a snack. When you hand somebody a plate of something to eat or even a cookie, they will typically say Gracias, and your response would then be Buen Provecho.
When you have people sit at a table in your house, and they are ready to dig in, you say Been Provecho as they are sitting down, and they would then compliment the taste or aroma and you will then say Gracias.
You are basically wishing them that they enjoy their meal or snack (no stomach ache, settles well with them) in any setting. So think along the lines of "Enjoy your meal".