Both great answers above me. I'll just add in that ATC is supposed to use the phrase "SID cancelled...[do this]" if they want you to climb unrestricted (or "STAR cancelled..." for an arrival). Otherwise, you've got to continue flying the published profile.
For example, I was descending into an airport the other week and given a clearance to descend to 5,000 feet. I was at 7,000 feet already with 20 miles to run to a waypoint with a 6,500' crossing restriction. I asked if he was cancelling the STAR and he said no. When he called back a minute later asking why I had not started the descent, I explain the altitude restriction...the response of "of yeah [pause]. STAR cancelled, fly present heading; descend to 5,000" was a great reminder that the controllers can forget the rules too...but it'll still be your fault if you break them!