Question: What does "school lunch" mean in American English? Is it ambiguous between a lunch provided by a school and a lunch prepared at home like a bag lunch?

Answer: 
A school lunch can either be:

* a lunch prepared and served in the school cafeteria, or
* a lunch prepared at home and taken to school to be eaten there.

When I hear the term "school lunch," I typically think of the former meaning first. However, as was stated in a comment by @userr2684291, the latter meaning is still valid. (Just because a phrase **usually** means one thing doesn't mean it **never** means another.) Here are a couple quotes that use the term in this way:

> 
> *When I was in the second grade, my mom packed my school lunch every day in a brown paper bag*. (Aegina Angeliades, *My Skin Don't Fit*, 2014)
> 
> 
> *If you need fresh ideas for making healthy school lunches, leftovers can save the day*. ([VegKitchen website](http://www.vegkitchen.com/recipes/leftover-heaven-ideas-for-school-and-brown-bag-lunches/))
> 
> 
> 

---

As a footnote, you should remember that any two-word term like "school lunch" may have more than one meaning. Moreover, when you say "in American English," you should know that [**regionalisms** may and often do apply](https://en.wikipedia.org/wiki/Regional_vocabularies_of_American_English#Regionalisms). 

*Hotdish and a frappe for lunch, anyone?*
I'm not American but "**[school lunch](https://en.wikipedia.org/wiki/School_meal)**" is a meal, typically in the middle or beginning of the school day, provided to students at school. That's what Wikipedia says.

Your second description "*lunch prepared at home like a bag lunch*" is actually a "**[packed lunch](https://en.wikipedia.org/wiki/Packed_lunch)**" (or **bag lunch** in North America) - a lunch prepared at home and carried to be eaten somewhere else, such as school, a workplace, or at an outing. As says Wikipedia.