Microsoft has an FAQ about the use of their trademark.
From that FAQ:
Can I use a Microsoft logo to indicate that my product or service runs
on or is compatible with a Microsoft technology or service?
long as you have a signed logo license agreement with Microsoft.
Microsoft has many logo programs to indicate compatibility with
various software, products, and services. For your product to be
eligible to display a Microsoft logo, you will be required to
demonstrate Microsoft-defined performance and compatibility standards
for your product or service. If you do not have a signed logo license
agreement from Microsoft, you may not use any Microsoft logo to
indicate compatibility with Microsoft software, products, or services.
So it looks like technically, to claim your software runs on Windows, you need to have it logo certified. More information about getting your project certified can be found here.
You might be able to fudge the legal lines with the follow:
Can I use a Microsoft logo in my school project?
It is okay to use Microsoft logos in school projects such as book
reports, stories, or articles about or involving Microsoft or its
software, products, and services. The project should be displayed,
used in, or directed to an academic environment.
But it's a stretch. Universities often have legal departments you can ask them if you're uncertain.
Other companies likely have similar requirements, and you'll need to research each company individually if you want to know the true requirements.