Perast has no hostel and no cheap bed, so treat it as a €1.50 bus ride rather than a place you sleep — the walking is free and everything else is not.
Come on the local bus
The Kotor–Risan service stops on the main road above the village roughly hourly and costs about €1.50, then it is a short walk down the steps. A taxi for the same 12km is many times that.
Sleep in Kotor
There is no dorm bed in Perast at all. The nearest is in Kotor's Old Town, where Montenegro Backpackers Home charges from €18 in April to €50 in August and is open 25 April to 31 October.
The free half of Perast is most of it
The waterfront street, the lanes climbing behind it and the views back over the two islands cost nothing, and they take about two hours. Budget for the boat and one meal, not for a list of sights.
Check the last bus before you settle in
Once the last service back to Kotor goes, the village empties and your options are an expensive room or an expensive taxi. Ask at the stop on the main road when you arrive.
What a day costs
About €3 return on the bus from Kotor, €5–10 for the boat out to Our Lady of the Rocks and roughly €2 for the bell tower — under €20 before you eat. Lunch on the quay is the line that breaks it.