14 CFR 91.123(a) requires that you request clarification from ATC at any time you are uncertain of a clearance. This regulation governs your question at all times.
91.177(b) specifies that the climb to a higher minimum IFR altitude shall begin immediately after passing the point beyond which that minimum altitude applies, except where a MCA is specified. In that case, the MCA crossing altitude becomes ruling.
On arrival and departure proceedures, any published altitudes are not mandatory unless told to climb or descend via the proceedure.
Per AIM 5-2-6, two types of Departure Proceedures (DP's) exist; the Obstacle Departure Proceedure, and the Standard Instrument Departure (SID). Collectively we refer to these as DP's. You may fly the ODB (obstacle departure) without ATC clearance, unless a specific different clearance or clearance to the contrary has been received. In fact, in absence of instructions to the contrary, you should always fly the obstacle departure.
The SID, or standard instrument departure, on the other hand, may not be flown without ATC clearance. Any time you are flying a departure proceedure, weather a SID or ODP, you are always responsible for terrain and obstacle obstruction, weather in radar contact or not. Only when you accept a vector has ATC taken that responsibility. Therefore, if flying a DP and believe that obstacle protection will be an issue due to your altitude, it is your responsibility to query ATC, and in lieu of a clearance or communication, take necessary action to preclude ground or obstacle contact.
When told to comply with the restrictions appended to a proceedure, weather a DP or STAR, you are expected to adhere to the restrictions. That's really quite straight forward. Restrictions may include airspeed and altitude; if told to comply with all restrictions, you must do so unless an ammended clearance is received.
If vectored, or assigned an altitude, those restrictions are canceled. If placed back on the proceedure, any relevant restrictions must be restated.
If told to fly XXX proceedure, climb and maintain 2,000', then you climb and maintain 2,000. You now have a restriction of 2,000, and do not climb or fly in accordance with the published altitudes or restrictions. If you feel that you should climb above that due to a published altitude, then query ATC; you're responsible for terrain separation until receiving a vector. If told to resume the departure, any restrictions that will apply to you must be restated.
On an arrival, you are not to adhere to published altitudes unless told to descend via the arrival. In either case, when told to adhere to all restrictions, you adhere to them unless you maintain an ammended clearance. At all times, if you are unsure, you are required to query ATC.
When given a DP and no climb instructions, or altitude resrictions or limitations, you are expected to climb in accordance with the DP.