The nature of the substrate (in particular the degree of substitution of the α-carbon) is of principal importance in determining which mechanism predominates. Generally, $\mathrm{S_N1}$ and $\mathrm{E1}$ are both less common than $\mathrm{S_N2}$ and $\mathrm{E2}$, partially as a consequence of their first-order kinetics and the stability constraints imposed by the charged intermediate species the mechanisms generate. $\mathrm{S_N1}$ and $\mathrm{E1}$ both require tertiary, allylic, or benzylic α-carbons in order to be viable (although secondary carbons can occasionally react by these pathways as well, but slowly, and only if conditions disfavor competing reactions), mainly because the carbocation intermediate that forms during the rate-determining step can be stabilized by the neighboring electron-donating alkyl groups via hyperconjugation (or via resonance in the case of carbons in allylic or benzylic positions). Tertiary carbons also disfavor $\mathrm{S_N2}$ because the approach of the nucleophile is sterically hindered by the β-alkyl groups. Under those conditions, $\mathrm{E1}$ and $\mathrm{S_N1}$ reactions would be in competition. $\mathrm{E1}$ would be favored if there were no strong nucleophiles present, as well as by the application of heat. Obviously, $\mathrm{S_N2}$ reactions are favored by the presence of strong nucleophiles (ideally, ones that don't also act as strong bases) and a primary α-carbon substrate. $\mathrm{E2}$ reactions are favored over $\mathrm{S_N2}$ if strong bases, especially non-nucleophilic, are present. $\mathrm{E2}$ also prevails when either the substrate and/or the base is sterically hindered, since abstraction of a proton is vastly less impacted by steric factors than is the approach of a nucleophile attacking a carbon with simultaneous loss of the leaving group. Finally, $\mathrm{E2}$ reactions impose an additional restriction in that the β-hydrogen and the leaving group must be anti-periplanar to one another, in order for simultaneous loss of the leaving group and formation of the π-bond to occur in a coordinated fashion. If the molecule can't adopt such a conformation (for example, it may be rotationally locked due to the presence of π-bonds, or lack the kinetic energy necessary for a ring flip, etc.), then $\mathrm{E2}$ is categorically ruled out.
(Parenthetically, I should add that elimination reactions, in general, require higher temperatures than substitution reactions. The naive explanation for this is based on the equation for the free energy change of a reaction: $\Delta G = \Delta H\ -\ T\Delta S$. Elimination reactions, at the most simplified level, involve two reactant molecules [namely, a base and the substrate], and yield three products [the protonated base, the substrate molecule that has undergone elimination, and the substrate's leaving group]. Consequently, elimination reactions are entropically favorable [i.e., the $T\Delta S$ term is positive]. However, elimination reactions are also endothermic [i.e., $\Delta H$ is positive], because heat energy is required to break the two σ-bonds of the abstracted proton and the leaving group, while the resulting products form only one σ- and one π-bond, the latter of which is less stable. The implication of this is that, in order for the overall change in free energy, $\Delta G$, to be negative [a requisite condition for spontaneity of the reaction], $T\Delta S$ must be greater than $\Delta H$, so the temperature needs to be sufficiently high if the reaction is to take place.)
The solvent is of only slightly less importance. Polar protic solvents (water, alcohols, weak carboxylic acids, etc.) have partial-positive hydrogens, which serve to stabilize negatively charged species. Consequently, $\mathrm{E2}$ and $\mathrm{S_N2}$ mechanisms, which are aided by having negatively charged bases or nucleophiles in high concentration, are somewhat dampened by protic solvents, allowing otherwise disfavored $\mathrm{E1}$ and $\mathrm{S_N1}$ pathways to compete. Polar aprotic solvents (THF, DMF, DMSO, chloroform, ethers, ketones, etc.) cannot stabilize negative charges as effectively, making them the preferred choice when $\mathrm{E2}$ or $\mathrm{S_N2}$ mechanisms are desired.
Finally, to your specific question about haloalkanes. I've explained above why various combinations of conditions might favor one class of reaction over another. In water, specifically, a few distinct factors, beyond the general principles outlined above, might be relevant:
- Due to the leveling effect, no base stronger than hydroxide can exist in water at any appreciable concentration (that is, any base much stronger than hydroxide will simply deprotonate the water molecules, forming hydroxide and the base's conjugate acid). However, strong, non-basic nucleophiles are not subject to this effect, and though they may be solvated and weakened by hydrogen bonding, this effect would be less drastic than the protonation that strong bases would undergo.
- Hydroxide is actually a much stronger base in many other solvents than it is in aqueous solution, which is chiefly the result of it being very thoroughly solvated and stabilized by hydrogen bonding. Hence, competing nucleophiles become stronger by comparison, while stronger bases simply end up being consumed, producing more hydroxide.
- Because elimination reactions require heat, substitution reactions will be heavily favored and immediately take place unless the reaction vessel is heated prior to mixing of the reagents. The problem is compounded by the fact that, with hydroxide as the nucleophile, an alcohol would form, which would be stabilized by hydrogen bonding with water molecules. Further, because haloalkanes are poorly soluble in water, and immiscible liquids in the same container will boil at lower temperatures than they would unmixed, it could become very difficult in practice to achieve the temperatures necessary to favor elimination reactions while also maintaining the agitation necessary to keep the haloalkane and the aqueous phase from completely separating.