Can you simply create a single project and then put it on your (Android) phone/compile it on your PC depending on where you want to test it, or do you need separate projects for different platforms?
Yes, you can create a single project and build it for each platform you want to target. This is one of the major benefits / reasons to use a multiplatform game engine like Unity.
For a very simple project, this should mostly "just work" - you select your build platform from the build settings dialog and you're off to the races.
As you start using more platform-specific libraries, tools, input conventions, etc. you might need to expand on this with things like native plugins, conditional compilation, asset bundles, or custom build scripts to control what gets included in each platform, or abstraction layers to keep the bulk of your game code & content cross-platform.
Andrew Carvalho of Laundry Bear Games gave a great talk about how to do this type of platform-specific work at EGLX 2018 - I tried to capture some of the main points in a livetweet thread. Keep an eye out for the video of the session to get the whole story.
This work tends to be very bespoke for the type of per-platform adjustments a particular game needs, so if you find that you need more than what comes out of the box, you can post a new question here detailing the specific task you need to accomplish / build errors you're getting, and how you're trying to solve them, to get tailored help in making it work.