You pay maintenance for combat ships (ships with any kind of weapons) and constructors (ships with a constructor module).
The amount you pay is 3.5% of the ship's build-cost. The only exception are constructors. They use a different amount, but I haven't figured out yet how to calculate it. In any case, you can see how much maintenance you need to pay, if you look at a ship's Details screen. You can also see it, if you look at the design of the ship in the Ship Designer.
You always need to pay maintenance, no matter where the ship is.