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: 
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.
To add on to the other answers: "School lunch" is ambiguous. It could be provided by the school for the midday meal, or one that you bring with you to eat at school. Without context, you don't know for sure which is meant, or even if there is any relevant difference.

In addition, "school lunch" (commonly "lunchtime") can also be the *time period* during which students normally eat the midday meal, and then go play or talk or whatever else they are permitted to do during that break time. Example:

> 
> Mister Potter. As you have been told, **school lunch** is for eating or playing with your friends. It is not for drawing magic circles and transforming your fellow students into newts. We are not that kind of school.
> 
> 
> 

Again, context is important to understand which is meant.