In the US, something made by an employee within the scope of his or her employment is a work made for hire and the employer owns the copyright.
Non-employees could also agree to a contract transferring copyright or, in some limited circumstances, agreeing the work is a work made for hire.
But I'm fairly sure that you're wrong about things you write for school, unless you're an employee of the school or you signed something transferring copyright.