The electrostatic potential across a short ballistic molecular conductor depends sensitively on the geometry of its environment, and can affect its conduction significantly by influencing its energy levels and wave functions. We illustrate some of the issues involved by evaluating the potential profiles for a conducting gold wire and an aromatic phenyl dithiol molecule in various geometries. The potential profile is obtained by solving Poisson's equation with boundary conditions set by the contact electrochemical potentials and coupling the result self-consistently with a nonequilibrium Green's function formulation of transport. The overall shape of the potential profile (ramp versus flat) depends on the feasibility of transverse screening of electric fields. Accordingly, the screening is better for a thick wire, a multiwalled nanotube, or a close-packed self-assembled monolayer, in comparison to a thin wire, a single-walled nanotube, or an isolated molecular conductor. The electrostatic potential further governs the alignment or misalignment of intramolecular levels, which can strongly influence the molecular current-voltage (I-V) characteristic. An external gate voltage can modify the overall potential profile, changing the I-V characteristic from a resonant conducting to a saturating one. The degree of saturation and gate modulation depends on the availability of metal-induced-gap states and on the electrostatic gate control parameter set by the ratio of the gate oxide thickness to the channel length.